Adding a simple health check endpoint
You want to add a simple health check endpoint to your app.
Questo esercizio fa parte del corso
Deploying AI into Production with FastAPI
Istruzioni dell'esercizio
- Add a GET endpoint at the typical location for health checks.
- Return a status of
"OK".
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
from fastapi import FastAPI
app = FastAPI()
# Create health check endpoint
@app.get("____")
async def get_health():
# Return status OK
return {"status": "____"}