Hello FastAPI is a tiny web server that responds to a GET request with a JSON response.
It exposes the following endpoints:
/api- returns a JSON response with a message "Hello, FastAPI!", env vars starting withHELLO_and request headers./docs- FastAPI's auto-generated API documentation./openapi.json- FastAPI's auto-generated OpenAPI schema.
python3 -m venv .venv
source ./.venv/bin/activate
pip install -r requirements.txtRun via uvicorn cli:
uvicorn main:app --port 5001 --reloadBulild and run via docker:
docker build -t hello-fastapi .
docker run --rm -p 5001:8000 hello-fastapi