A simple archetype project to build REST services with python, poetry and fastapi.
Licensed under Apache 2.
-
Install
pre-commit
hook for enforcing code conventionspoetry install poetry run pre-commit install
-
Run the dev server
poetry run uvicorn rest_services.main:app --reload
-
Interact with API at: http://127.0.0.1:8000/docs Or http://127.0.0.1:8000/redoc
-
Run tests
poetry run python3 -m pytest -v
-
Build container image
docker build . -t knowprocess/rest_services:latest
-
Run app within image
docker run -p 8000:80 knowprocess/rest_services & open http://localhost:8000/docs