FastAPI

Quick Start

main.py
from fastapi import FastAPI

app = FastAPI()


@app.get("/")
async def root():
    return {"message": "Hello World"}
uvicorn main:app --reload

FastAPI App

Hierarchy

getting-started-with-fastapi/
├── app/
│   ├── __init__.py
│   ├── crud.py
│   ├── database.py
│   ├── main.py
│   ├── models.py
│   └── schemas.py
├── Dockerfile
└── requirements.txt

Deployment

Last updated