Skip to content

aurium/js-game-server

Repository files navigation

The game server for the js13kGames Competition.

Build Status dependency status dev dependency status

Deploy

$ git clone git://github.com/js13kGames/js-game-server.git
$ cd js-game-server
$ npm install
$ npm test

Running

$ cd /path/to/js-game-server
$ npm start

Configuring

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.

Playing

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.

Contributing

Register an issue, clone, code, push and request a merge.

About

Sandboxed JavaScript Game Server **(moved!)**

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published