The game server for the js13kGames Competition.
$ git clone git://github.com/js13kGames/js-game-server.git
$ cd js-game-server
$ npm install
$ npm test
$ cd /path/to/js-game-server
$ npm start
You can place the configuration in one of this places:
- user local config dir:
$HOME/.config/js-game-server/config.json
- system config dir:
/etc/js-game-server/config.json
- in the application root:
<js-game-server-dir>/config.json
This list is ordered in precedence order.
The config.json
is a JSON file with this structure:
{
"games_directory": /* where the server can find game dirs to load? */,
"sanctioned_modules": [ /* external allowed modules for sandbox require */ ],
"log": { /* this section is optional */
"withColors": /* (boolean) colors on console output */,
"silentSTDIO": /* (boolean) stop console log */,
"toFile": /* (string) a file path, or "STDIO" */
},
"domain": /* (string) defaults to localhost */
"lobbyPort": /* (integer) the main httpd, that list games. */,
"gamePortStart": /* (integer) Game ports are sequential. */
}
Colorful logs are useful for devs, but not for grep in production history.
If you don't change the defaults, visit http://localhost:3000
and you will see the game lobby, listing the example games. Click on any game and you will get it in another port with it's own http server.
Register an issue, clone, code, push and request a merge.