From b4801c29b56b821caee737decdd089d4daa444a6 Mon Sep 17 00:00:00 2001 From: Alexander Bazo Date: Thu, 10 Oct 2019 13:16:34 +0200 Subject: [PATCH] Make path to client a passable server argument --- index.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 94371e2..d5d3853 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ const http = require("http"), var app = express(), server = http.createServer(app), + pathToClient = process.argv[2], gameServer; // Logger.enable(); @@ -29,7 +30,7 @@ gameServer.define(Config.getGameRoomName(), StarGazerRoom); app.use(Config.getSocialRoute(), socialRoutes); app.use(Config.getMonitorRoute(), monitor(gameServer)); // Prrobably shoud be set after game server is created -app.use(Config.getGameRoute(), express.static(Config.getGamePath(), { +app.use(Config.getGameRoute(), express.static(pathToClient, { maxAge: 100 })); diff --git a/package.json b/package.json index 8de2d31..b29dd27 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "npm init template for bootstraping an empty Colyseus project", "main": "index.js", "scripts": { - "start": "node index.js", + "start": "node index.js ../StarGazerClient/build", "loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2", "test": "echo \"Error: no test specified\" && exit 1" }, -- libgit2 0.26.0