- Install dependencies
npm i
- Configure your
.env
file like follow
// This app uses SQLITE, you can specify the path where you want to be your database file or use yours.
// Default value : db.sqlite
DATABASE_PATH=...
// Configure your port where the server will run
// Default value : 3000
PORT=...
- Start the server
npm start
Here is the differents routes that you can use :
GET /game/play/rock
GET /game/play/paper
GET /game/play/scissors
GET /game/score
GET /game/scores
POST /game/restart
PUT /game/score/:win/:lose/:tie
Why do I create a new score instance and get the last one instead of reset all values of the first ?
I wanted to keep a trace of all games played.