At this point, both the empires and the tictactoe implementation have
an identical implementation of the "/events" route so we push this up
to the lmno.js file.
response.send(game.players);
});
-router.get('/events', (request, response) => {
- const game = request.game;
- game.handle_events(request, response);
-});
-
exports.router = router;
exports.Game = Empires;
response.render(`${game.meta.identifier}-game.html`);
});
+ engine.router.get('/events', (request, response) => {
+ const game = request.game;
+
+ game.handle_events(request, response);
+ });
+
/* And mount the whole router at the path for the game. */
app.use(`/${engine.Game.meta.identifier}/[a-zA-Z0-9]{4}/`, engine.router);
}
game.broadcast_move(square);
});
-router.get('/events', (request, response) => {
- const game = request.game;
-
- game.handle_events(request, response);
-});
-
exports.router = router;
exports.Game = TicTacToe;