fix(api): 恢复 /health 根路径健康检查端点

Docker/Nginx 健康检查请求 /health 返回 404,
在 main.py 中重新添加轻量级 /health 端点供负载均衡使用。
This commit is contained in:
小鱼开发
2026-05-15 17:08:34 +08:00
parent 4fa8bd7c65
commit ffcbb5105d
+10
View File
@@ -286,6 +286,16 @@ def create_app() -> FastAPI:
},
)
# 健康检查(根路径,供 Docker/Nginx 负载均衡使用)
@app.get("/health", tags=["System"])
async def health_check():
"""服务健康检查"""
return ApiResponse(
code=200,
data={"status": "healthy"},
message="服务运行正常",
)
# 根路由
@app.get("/", tags=["System"])
async def root():