This a simple api built with Flask microframework
-
Pyhon3 Python is a programminglanguage that lets you work quickllu and integrate more effectively
-
Flask Flask is a microframework written in Python
-
Poetry Python Packaging and dependency management
-
Flask SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application
-
Flask Migrate Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic
-
Docker Docker takes away repetitive, mundane configuration tasks and is used throughout the development lifecycle for fast, easy and portable application development
-
Docker Compose Compose is a tool for defining and running multi-container Docker applications
GET /api/dog
POST /api/dog
DELETE /api/dog
PUT /api/dog
Will return all dogs record from database
{
"results": [
{
"name": "Pluto",
"age": 10,
"color": "brown",
"gender": "male",
"breed": "Bloodhound",
"size": "large"
},
{...}
]
}
Add a new dog to the database
{
"name": "Pluto",
"age": 10,
"color": "brown",
"gender": "male",
"breed": "Bloodhound",
"size": "large"
}
Delete an existing record with the specific id
Update an existing record with the specific id
{
"name": "Pluto",
"age": 11,
"color": "brown",
"gender": "male",
"breed": "Bloodhound",
"size": "large"
}
Build the image:
docker build -t simple-flask-api:lastest -f simple-flask-api/Dockerfile simple-flask-api
Run the container with following command:
docker run -p 5000:5000 simple-flask-api:latest