Skip to content
A simple Node server for adding a leaderboard functionality to a game.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
src
test
.gitignore
.jscsrc
.jshintrc
Dockerfile
LICENSE
README.md
docker-compose.yml
package.json
server.js

README.md

SimpleScore

A simple Node server for adding a leaderboard functionality to a game. It provides an API to accept scores and return them for later display in the game.

For a demo, I modded my Deathbot 5000 game, playable here.

Running the server

To run the server locally, you'll first need to be running a MongoDB server. Then you can install the dependencies and run the server:

$ npm install
$ DB_URI=mongodb://127.0.0.1:27017/simpleserver_dev npm start

Then open http://127.0.0.1:8080/api.

To run tests:

$ DB_URI=mongodb://127.0.0.1:27017/simpleserver_test npm test

If you don't want to install Node and Mongo manually, you can run the server using Docker Compose. Just run docker-compose up and the server will be available on port 8080 on your Docker host machine (on a Mac using docker-machine, you'll probably find it at http://192.168.99.100:8080/api).

You can’t perform that action at this time.