The leaderboard website displays scores submitted by different players. It also allows you to submit your score.
Additional description about the project and its features.
-
Major languages (HTML, CSS, JavaScript)
-
Frameworks (None)
-
Technologies used
- Webpack(Code Bundlng et al) - Git(version control) - ESLint(JavaScript linting) - WebHint(linting tool) - Stylelint(style linting)
To get a local copy up and running follow these simple example steps.
- A text editor(preferably Visual Studio Code)
$ git clone git@github.com:AnselemOdims/LeaderBoard.git
$ cd LeaderBoard
$ npm install
$ npm run start # this will make webpack watching for your changes in code
$ open dist/index.html
- Each new game is created with the POST method using
{ "name": "My cool new game" }
This request returns a result that holds the unique ID for that game:
{
"result": "Game with ID: Zl4d7IVkemOTTVg2fUdz added."
}
This gameID is saved in the localStorage automatically
The two allowed actions are posting and getting of the scores
-
The POST request creates a new Leaderboard score for the given game sending user and score as parameters like this:
https://us-central1-js-capstone-backend.cloudfunctions.net/api/games/:id/scores/
body parameters
{ "user": "John Doe", "score": 42 }
and it returns
{ "result": "Leaderboard score created correctly." }
-
The GET request returns data in JSON format like this:
https://us-central1-js-capstone-backend.cloudfunctions.net/api/games/:id/scores/
It returns
{ "result": [ { "user": "John Doe", "score": 42 }, { "user": "Peter Parker", "score": 35 }, { "user": "Wonder Woman", "score": 50 } ] }
👤 Anselem Odimegwu
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.