]> git.cworth.org Git - lmno-server/blobdiff - tictactoe.js
Rename "app" to "router" within each game engine
[lmno-server] / tictactoe.js
index 766c1e4ed569cf9d2efb52bae9e7d70ffc6ce6fa..a38cea0e807f02d4e1aea2448263c7a2ebdbae1e 100644 (file)
@@ -1,6 +1,6 @@
 const express = require("express");
 
-const app = express.Router();
+const router = express.Router();
 
 class TicTacToe {
   constructor() {
@@ -54,7 +54,7 @@ class TicTacToe {
   }
 }
 
-app.get('/', (request, response) => {
+router.get('/', (request, response) => {
   const game = request.game;
 
   if (! request.session.nickname)
@@ -63,7 +63,7 @@ app.get('/', (request, response) => {
     response.render('tictactoe-game.html');
 });
 
-app.post('/move', (request, response) => {
+router.post('/move', (request, response) => {
   const game = request.game;
   const square = request.body.square;
 
@@ -79,7 +79,7 @@ app.post('/move', (request, response) => {
   game.broadcast_move(square);
 });
 
-app.get('/events', (request, response) => {
+router.get('/events', (request, response) => {
   const game = request.game;
 
   /* These headers will keep the connection open so we can stream events. */
@@ -99,6 +99,6 @@ app.get('/events', (request, response) => {
   });
 });
 
-exports.app = app;
+exports.router = router;
 exports.name = "tictactoe";
 exports.Game = TicTacToe;