

Lesson 01 · 9 min
A first app
A decorator over a function, and you have a route with docs.
9 minLesson 1 of 9Practice includedAsk AI on any point
FastAPI builds routes from decorators: @app.get("/") over a function. A returned dict becomes JSON. The uvicorn server runs the app. At /docs there's interactive Swagger documentation right away, generated from your functions and types.
- A virtual environment:
python -m venv .venv, then activate it. - Dependencies are pinned in
requirements.txtorpyproject.toml. /redocis another documentation view.
Check
Lock it in before you move on
1. Where is the API documentation in FastAPI?
2. A function returned a dict. What does the client get?
3. When do you write
async def?