from fastapi import FastAPI
app = FastAPI()
@app.on_event("startup")
async def startup_event():
print("Starting up...")
# Initialize DB connection
# Load ML model
# Create connection pool
@app.on_event("shutdown")
async def shutdown_event():
print("Shutting down...")
# Close DB connections
# Clean up resources