fix: health 接口动态返回版本号
This commit is contained in:
+3
-3
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user