Files
fastapi/docs_src/behind_a_proxy/tutorial002_py310.py
2026-02-12 14:19:43 +01:00

9 lines
208 B
Python

from fastapi import FastAPI, Request
app = FastAPI(root_path="/api/v1")
@app.get("/app")
def read_main(request: Request):
return {"message": "Hello World", "root_path": request.scope.get("root_path")}