From bb7a4c7361ba80cde9d6ad0cac19a4d0425c08c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E6=96=B0=E9=9B=A8?= Date: Tue, 3 Feb 2026 01:44:25 +0800 Subject: [PATCH] fix:main.py --- server/app/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/app/main.py b/server/app/main.py index f611d48..783fd4a 100644 --- a/server/app/main.py +++ b/server/app/main.py @@ -9,7 +9,7 @@ def create_app() -> FastAPI: """ 创建 FastAPI 应用实例。 - 说明:目前仅提供最小可运行骨架(health check),后续逐步加入路由与中间件。 + 说明:目前仅提供最小可运行骨架(健康检查),后续逐步加入路由与中间件。 """ settings = get_settings() @@ -20,6 +20,13 @@ def create_app() -> FastAPI: app.include_router(user_profile_router) app.include_router(reco_router) + @app.get("/health") + async def health() -> dict: + """ + 部署健康检查(兼容常见探针路径)。 + """ + return {"status": "ok", "env": settings.app_env} + @app.get("/healthz") async def healthz() -> dict: return {"status": "ok", "env": settings.app_env}