FastAPI - Hello World
examples/fastapi/hello-world/main.py
from fastapi import FastAPI app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"}
uvicorn main:app --reload
Visit http://localhost:8000/
Visit http://localhost:8000/docs to see the documentation generated by Swagger UI
Visit http://localhost:8000/redoc to see the documentation generated by Redoc
- path - endpoint - route