A typed API starter for the Wodby FastAPI service and FastAPI stack.
It demonstrates:
- application construction and
APIRoutercomposition - Pydantic request and response models
- validation errors and generated OpenAPI documentation
- JSON, health, not-found, and method-not-allowed responses
- pytest, Ruff, Gunicorn with Uvicorn workers, and Wodby CI
uv sync
uv run pytest
uv run fastapi devOpen http://localhost:8000. Useful endpoints are:
/— API metadata and documentation links/docs— interactive Swagger UI documentation/redoc— ReDoc documentation/api/status— a typed response examplePOST /api/greetings— typed request validation/healthz— the deployment health endpoint
Try the request model:
curl -X POST http://localhost:8000/api/greetings \
-H 'content-type: application/json' \
-d '{"name":"Ada","enthusiastic":true}'main.pypreserves Wodby'smain:appproduction entrypoint.app/application.pycreates and composes the API.app/models.pydefines the public request and response contracts.app/routers/groups related endpoints.
Uvicorn accepts forwarded headers only from configured trusted peers. When
deploying behind a proxy that needs to control client or scheme information,
set FORWARDED_ALLOW_IPS to that proxy's explicit addresses. Avoid * unless
the application network is isolated so only trusted proxies can connect.
The example API is intentionally stateless: in-memory records would diverge between Gunicorn workers. Add a persistent datastore when implementing CRUD.