INACTIVE - http://mzl.la/ghe-archive - To infinity and beyond. The backend API.
Перейти к файлу
Chris Van 2eca7b2d65 Merge pull request #250 from AdrianGaudebert/working-unit-tests
Working games and etc unit tests.
2014-11-25 16:26:17 -08:00
api Working games and etc unit tests. 2014-10-24 20:03:56 +09:00
bin load Redis only once, add separate dev/prod/test settings files, use different Redis for database for tests 2014-08-25 16:20:27 -07:00
images add galaxy-api logo to README 2014-09-02 11:41:28 -07:00
lib s/member/user/ in leaderboard API 2014-08-26 19:32:41 -07:00
.gitignore load Redis only once, add separate dev/prod/test settings files, use different Redis for database for tests 2014-08-25 16:20:27 -07:00
.travis.yml Add Travis config 2014-11-25 15:36:26 -08:00
CONTRIBUTING.md add CONTRIBUTING.md 2014-08-28 16:36:19 -07:00
LICENCE add LICENCE 2014-08-28 16:36:19 -07:00
README.md add Travis CI Build Status badge to README (issue #234) 2014-11-25 16:22:43 -08:00
apiary.apib api docs: fix /game -> /games (fixes #238) 2014-09-08 08:37:52 +02:00
gulpfile.js add jshint for code linting 2014-08-13 15:27:09 -07:00
index.js remove 'X-Powered-By' header 2014-08-26 16:16:13 -07:00
package.json 0.0.4 2014-08-26 15:52:17 -07:00
settings.js forgo CLI in favour of external settings files 2014-08-26 15:51:57 -07:00
settings_dev.js.dist load Redis only once, add separate dev/prod/test settings files, use different Redis for database for tests 2014-08-25 16:20:27 -07:00
settings_prod.js.dist load Redis only once, add separate dev/prod/test settings files, use different Redis for database for tests 2014-08-25 16:20:27 -07:00
settings_test.js.dist load Redis only once, add separate dev/prod/test settings files, use different Redis for database for tests 2014-08-25 16:20:27 -07:00

README.md

galaxy-api logo

Build Status

Here lies the API for Galaxy.

There is a REST HTTP API and WebSocket API. The REST API can be consumed by game developers. The WebSocket API is intended to be consumed by galaxy.js, a simple drop-in JavaScript API for multiplayer, web-based games.

Note: This project is not ready for prime time. Not an official Mozilla project. Pre-alpha everything. Anything and everything at your own risk.

Installation

To install dependencies:

npm install

Node 0.11.x is required for the --harmony flag which enables generators (required for Koa, the web framework). If you're running an earlier version of Node you may install n, a node version manager to quickly install 0.11.x:

npm install -g n
n 0.11.12

Other dependencies:

redis

Development

Initialise settings, if you haven't already:

cp ./settings_dev.js.dist ./settings_dev.js

Set these environment variables:

NODE_ENV=development
GALAXY_API_SETTINGS=./settings_dev.js

To run the local web server:

nodemon --harmony bin/api

Alternatively:

npm run-script dev

To run linting tools:

gulp lint

Production

Initialise settings if you haven't already:

cp ./settings_prod.js.dist ./settings_prod.js

Set these environment variables:

NODE_ENV=production
GALAXY_API_SETTINGS=./settings_prod.js

Node 0.11.x is required for the --harmony flag which enables generators (required for Koa, the web framework).

To run the web server in production:

node --harmony bin/api

Alternatively:

npm run-script prod

Testing

Initialise settings:

cp ./settings_test.js.dist ./settings_test.js

Set these environment variables:

NODE_ENV=test
GALAXY_API_SETTINGS=./settings_test.js

To run tests:

npm test

Deployment

To run the local web server:

node --harmony bin/api

Alternatively:

npm start