__ __ __ __
/ /___/ /____/ /_ ____ ________ ____/ /
/ / __ / ___/ __ \/ __ \/ ___/ _ \/ __ /
/ / /_/ / / / /_/ / /_/ / / / __/ /_/ /
/_/\__,_/_/ /_.___/\____/_/ \___/\__,_/
Ldrbored is a simple web-based game leaderboard visualization. It lists the stats and ranking of a fake set of players. It was written as a sample application to showcase the implementation of a simple REST API and web-based front-end.
Ldrbored requires the following software to be pre-installed in order to run:
Issue the following commands from a command shell to start the web server:
$ cd path/to/ldrbored
$ npm install
$ node api/server.js
Open a web browser to the following url:
http://localhost:3000/public
GET http://localhost:3000/stats/:user
OR
GET http://localhost:3000/stats?user=:user
Example
GET http://localhost:3000/stats/john-doe
// returns
[
{
user: "john-doe"
name: "time-working"
value: 240
createdAt: "2013-10-03T04:55:06.984Z"
_id: "I54rWoMsXvuGEjNZ"
},
...
]
GET http://localhost:3000/stats?name=:name
Example
GET http://localhost:3000/stats?name=time-on-twitter
// returns
[
{
user: "john-doe"
name: "time-on-twitter"
value: 240
createdAt: "2013-10-03T04:55:06.984Z"
_id: "I54rWoMsXvuGEjNZ"
},
...
]
POST http://localhost:3000/stats?name=time-on-twitter
Content-Type: application/json
Body:
{
user: "my-user-name"
name: "my-stat-name"
value: "my-stat-value"
}
Ldrbored has been tested on the following desktop web browsers:
- Google Chrome
- Mozilla Firefox
4+