FastAPI - Dynamic response
-
datetime
-
A small step ahead generating part of the content of the response dynamically.
from fastapi import FastAPI
import datetime
app = FastAPI()
@app.get("/")
async def root():
return {"message": f"Hello World at {datetime.datetime.now()}"}