An API to keep score of multiple bowling games.
Install python 3.6
Install the required packages:
pip3 install -r requirements.txt
Run the following command from the BowlingApp directory:
python -m unittest discover
Run the following commands from the BowlingApp directory:
Mac:
export FLASK_APP=api.py
python -m flask run
Windows:
set FLASK_APP=api.py
python -m flask run
Navigate to http://127.0.0.1:5000 to verify that BowlingApp is running.
Use a tool like curl or postman to make the following requests:
- GET /games returns all current games.
- POST /games will create a game. It requires the following json:
{
"game_id": 0,
"players": ["Player1", "Player2"]
}
- GET /games/{game_id} will return the specified game.
- PUT /games/{game_id} will add a roll to the player specified with the following json:
{
"player": "Player1",
"pins": 10
}
- DELETE /games/{game_id} will delete the specified game.
- DELETE /games will delete all games.