first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.core.config import Settings, get_settings
|
||||
from app.schemas.api import HealthResponse
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get(
|
||||
"/health",
|
||||
response_model=HealthResponse,
|
||||
summary="健康检查",
|
||||
description="用于负载均衡器、容器探针和运维监控。",
|
||||
)
|
||||
def health(settings: Settings = Depends(get_settings)) -> HealthResponse:
|
||||
return HealthResponse(
|
||||
status="ok",
|
||||
environment=settings.app_env,
|
||||
version="6.0.0",
|
||||
)
|
||||
Reference in New Issue
Block a user