fastapi/docs_src/behind_a_proxy/tutorial001.py

9 lines
189 B
Python

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