You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
952 B
33 lines
952 B
6 years ago
|
|
||
|
var express = require('express');
|
||
|
var app = express();
|
||
|
|
||
|
app.get('/get-players', function (req, res) {
|
||
|
res.setHeader('Content-Type', 'application/json');
|
||
|
res.send(JSON.stringify(players));
|
||
|
});
|
||
|
|
||
|
var last_announce_string = "none";
|
||
|
|
||
|
app.get('/last-announce', function (req, res) {
|
||
|
res.setHeader('Content-Type', 'text/plain');
|
||
|
res.send(last_announce_string);
|
||
|
});
|
||
|
|
||
|
app.get('/announce', function (req, res) {
|
||
|
last_announce_string = JSON.stringify(req.body);
|
||
|
console.log("announce got:"+last_announce_string);
|
||
|
res.setHeader('Content-Type', 'text/plain');
|
||
|
res.send();
|
||
|
});
|
||
|
|
||
|
|
||
|
var server = app.listen(3000, function () {
|
||
|
//console.log('express-handlebars example server listening on: 3000');
|
||
|
var host = server.address().address;
|
||
|
var port = server.address().port;
|
||
|
console.log("listserver address:");
|
||
|
console.log(JSON.stringify(server.address()));
|
||
|
console.log("(experimental WIP) Minetest master server is listening at http://%s:%s", host, port);
|
||
|
});
|