Serving a classification model via FastAPI.
make start
Once the docker finishes setting up database, cache, and api in the compose file. You can access the API at http://localhost:8080 and the documentation can be accessed at http://localhost:8080/docs.
make startup_db
cd app
poetry shell
make uvicorn
The documentation will provide your example curl request to interact with your api.
# Post data to the api.
curl -X 'POST' \
'http://localhost/users/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"email": "string",
"password": "string"
}'
And to fetch results back.
# Fetch results from the API.
curl -X 'GET' \
'http://localhost/users/?skip=0&limit=100' \
-H 'accept: application/json'