https://github.com/jadbox/leaderboard-js
This is a leaderboard game server in Node.js and uses either Redis or local node memory to store player state.
https://github.com/jadbox/leaderboard-js
Last synced: 19 days ago
JSON representation
This is a leaderboard game server in Node.js and uses either Redis or local node memory to store player state.
- Host: GitHub
- URL: https://github.com/jadbox/leaderboard-js
- Owner: jadbox
- Created: 2015-01-09T03:32:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-13T20:57:06.000Z (over 11 years ago)
- Last Synced: 2025-12-01T18:55:05.028Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 805 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Clone, get dependencies and run:**
```
git clone git@github.com:jadbox/leaderboard-js.git
cd leaderboard-js
npm install
node server.js
```
**Select DB**
See lines 8-9 in server.js
**Test case:**
With [HTTPie](https://github.com/jakubroztocil/httpie), run the client test script: [./test.sh](https://github.com/jadbox/leaderboard-js/blob/master/test.sh)
**Notes:**
* Registering a new user only requires a name, as a playerID will be generated.
* Example: ```http POST localhost:3000 name=Don event:=1```
* Reponse: ```{
"name": "Don",
"playerID": 1,
"status": "Success: registered player"
}```
* Deleting users require the DELETE HTTP method.
* Example: ```http DELETE localhost:3000 playerID="1"```
* Reponse: ```{
"playerID": 1,
"status": "Success: deleted player"
}```
* All event actions, aside from delete player, use the POST HTTP method
* New event ID route handlers can be added in the app-routes.js method ```eventRoutes()```
* Server port is 3000 by default (test.sh uses this) but can be speficied using the first arg.
* Example: ```node server.js 2000```
_See project files for documentation._