Commit c3df557d authored by Christian Paul's avatar Christian Paul 🦊

/players returns a JSON object with all players

parent f72f31fd
......@@ -101,10 +101,27 @@ app.get('/console',
}
);
app.get('/players',
ensureLoggedIn(),
function(req, res) {
res.setHeader('Content-Type', 'application/json');
if (cs2d.playersPlugin) {
res.end(JSON.stringify({
players: cs2d.playersPlugin.players,
success: true,
}));
} else {
res.end(JSON.stringify({
success: false,
}));
}
}
);
app.get('/start',
ensureLoggedIn(),
function(req, res) {
cs2d.start();
console.log('cs2d start', cs2d.start());
res.end();
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment