Fixes room list, adds OpenGraph so link previews look good
This commit is contained in:
1 parent
8b9a434be3
commit
c87654ed7c
2 files changed
+10
No files matched your search
@@ -352,6 +352,14 @@ app.get('/', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'public', 'menu.html'));
|
||||
});
|
||||
|
||||
app.get('/api/rooms', (req, res) => {
|
||||
const roomList = Object.keys(games).map(name => ({
|
||||
name,
|
||||
playerCount: games[name].players.length
|
||||
}));
|
||||
res.json({ rooms: roomList });
|
||||
});
|
||||
|
||||
// Socket.IO connection handling
|
||||
io.on('connection', (socket) => {
|
||||
let currentRoom = null;
|
||||
|
||||
Reference in new issue
Block a user