fix: healthz 路径改成 /api/v1/healthz(归到 API 前缀下)

This commit is contained in:
Mavis
2026-06-07 23:15:33 +08:00
parent eaa4aa6604
commit 2e75985a3c
3 changed files with 34 additions and 10 deletions

View File

@@ -103,7 +103,7 @@ app.include_router(admin.router, prefix=API_PREFIX)
# === 健康检查 ===
@app.get("/healthz", include_in_schema=False)
@app.get(f"{API_PREFIX}/healthz", include_in_schema=False)
async def healthz():
try:
await get_redis().ping()
@@ -112,6 +112,6 @@ async def healthz():
return {"status": "ok"}
@app.get("/", include_in_schema=False)
@app.get(f"{API_PREFIX}/", include_in_schema=False)
async def root():
return {"name": "diary-news", "version": app.version, "docs": "/api/docs"}
return {"name": "diary-news", "version": app.version, "docs": f"{API_PREFIX}/docs"}