FastAPI - Middleware and Hooks
Consider this FastAPI code snippet:
What will be printed when the server starts and then stops?
from fastapi import FastAPI
app = FastAPI()
@app.on_event("startup")
async def startup_event():
print("Starting app")
@app.on_event("shutdown")
async def shutdown_event():
print("Stopping app")
@app.get("/")
async def read_root():
return {"message": "Hello"}What will be printed when the server starts and then stops?
