BaşlayınÜcretsiz başlayın

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ı

Kursa Göz Atın

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": "____"}
Kodu Düzenle ve Çalıştır