During my bootcamp days I made a basic API with node/express of common beers in Japanese convience stores as a learning exercise. I used that project as a basis for making a basic API for Danish craft beers using python/flask
It stores the following data:
- Name of beer, as string
- Name of brewery, as string
- ABV, as float
- Type of beer as string
- Volume in ml, as integer
- Type of container, as string
The API returns the following beer object.
{
"id": 4,
"name": "Sweet Mary",
"brewery":"Svaneke",
"abv": 7.9,
"type": "Dobbelbock",
"receptacle_size": 500,
"receptacle_type": "bottle"
}
source env/bin/activate
pip install flask
pip install pytest
FLASK_APP=project/app.py python -m flask init-db
FLASK_APP=project/app.py python -m flask run
python3 -m pytest
Returns list of beers
Returns beer with stated id number
Adds a beer to list
Updates beer
Deletes beer