]> git.cworth.org Git - empires-server/blobdiff - empires.js
empires: Serve the actual game file from the root of the app
[empires-server] / empires.js
index 20dfa78d2102e6e1fe0d3b77bc23eb6cba729b30..593598ad6153c5c524fd2dfeaf7274f07cc36b63 100644 (file)
@@ -1,6 +1,7 @@
 const express = require("express");
 const cors = require("cors");
 const body_parser = require("body-parser");
+const path = require("path");
 
 const app = express();
 app.use(cors());
@@ -249,6 +250,10 @@ function handle_events(request, response) {
   });
 }
 
+app.get('/', (request, response) => {
+  response.sendFile(path.join(__dirname, './game.html'));
+});
+
 app.post('/register', (request, response) => {
   const game = request.game;
   game.add_player(request.body.name, request.body.character);