FastAPI sample app
- Docker
MySQL credentials are given by environment variables:
MYSQL_HOST
MYSQL_DATABASE
MYSQL_USER
MYSQL_PASSWORD
-
Start MySQL and Fast API.
docker compose up
-
Create a user.
curl -X 'POST' \ 'http://localhost:8000/users/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "email": "string", "password": "string" }'
-
Get users.
curl -X 'GET' \ 'http://localhost:8000/users/?skip=0&limit=100' \ -H 'accept: application/json'
-
For more details: http://localhost:8000/docs