~nora/fastapi-sandbox

FastAPI sandbox
Update requirements
Move app settings in config.py
Migrate to pydantic 2

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~nora/fastapi-sandbox
read/write
git@git.sr.ht:~nora/fastapi-sandbox

You can also use your local clone with git send-email.

#FastAPI Sandbox

This is a sandbox to play with FastAPI framework.

#Building and running

Install dependencies in a virtual environment.

pip install -r requirements.txt

Create configuration file in app/.env.

DATABASE_URL=postgresql://user:password@localhost/database

Run server (webpages reloaded on change).

uvicorn app.main:app --reload
uvicorn app.main:app --reload --reload-include *.html

#Testing

Execute all tests.

pytest app/tests.py

#Documentation

You can find the API doc locally at http://127.0.0.1:8000/docs.