Basit bir health check uç noktası ekleme
Uygulamana basit bir health check uç noktası eklemek istiyorsun.
Bu egzersiz, kursun bir parçasıdır
FastAPI ile Üretime AI Dağıtımı
Egzersiz talimatları
- Sağlık kontrolleri için tipik konumda bir GET uç noktası ekle.
"OK"durumunu (status) döndür.
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
from fastapi import FastAPI
app = FastAPI()
# Create health check endpoint
@app.get("____")
async def get_health():
# Return status OK
return {"status": "____"}