fix: health 接口动态返回版本号

This commit is contained in:
gouki
2026-08-01 13:54:22 +00:00
parent ae35cb5974
commit e29154518b
+3 -3
View File
@@ -14,10 +14,10 @@ async def lifespan(_: FastAPI):
yield yield
app = FastAPI(title="VPS 资产管理系统", version="0.1.1", lifespan=lifespan) app = FastAPI(title="VPS 资产管理系统", version="0.1.2", lifespan=lifespan)
@app.get("/health") @app.get("/health")
def health_check() -> dict: def health_check() -> dict:
"""健康检查""" """健康检查(version 动态读取,便于验证自动更新)"""
return {"status": "ok", "app": "vps-manager", "version": "0.1.0"} return {"status": "ok", "app": "vps-manager", "version": app.version}