Commit b4801c29 by Alexander Bazo

Make path to client a passable server argument

parent 084add1b
...@@ -12,6 +12,7 @@ const http = require("http"), ...@@ -12,6 +12,7 @@ const http = require("http"),
var app = express(), var app = express(),
server = http.createServer(app), server = http.createServer(app),
pathToClient = process.argv[2],
gameServer; gameServer;
// Logger.enable(); // Logger.enable();
...@@ -29,7 +30,7 @@ gameServer.define(Config.getGameRoomName(), StarGazerRoom); ...@@ -29,7 +30,7 @@ gameServer.define(Config.getGameRoomName(), StarGazerRoom);
app.use(Config.getSocialRoute(), socialRoutes); app.use(Config.getSocialRoute(), socialRoutes);
app.use(Config.getMonitorRoute(), monitor(gameServer)); app.use(Config.getMonitorRoute(), monitor(gameServer));
// Prrobably shoud be set after game server is created // 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 maxAge: 100
})); }));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "npm init template for bootstraping an empty Colyseus project", "description": "npm init template for bootstraping an empty Colyseus project",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js ../StarGazerClient/build",
"loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2", "loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment