- Move to the topic folder
- Create a virtual environment
- Activate the virtual environment on Mac
source .venv/bin/activate
- Activate the virtual environment on Windows
- Install dependencies
pip install -r requirements.txt
- Change to specific app dir
- Initialize database
python
from app import db
db.create_all()
- Start the Flask app
- Deactivate virtual environment
curl --location --request POST 'http://127.0.0.1:5000/levels/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "The Green Field"
}'
curl --location --request GET 'http://127.0.0.1:5000/levels/'
curl --location --request GET 'http://127.0.0.1:5000/levels/1'
curl --location --request PUT 'http://127.0.0.1:5000/levels/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "The Blue Field"
}'
curl --location --request DELETE 'http://127.0.0.1:5000/levels/1'