Skip to content

Commit ce38bdb

Browse files
authored
Merge pull request #90 from pdtkts/main
feat: add public health check endpoint
2 parents db559a8 + bacd494 commit ce38bdb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/api/admin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,17 @@ async def logout(token: str = Depends(verify_admin_token)):
11021102
return await admin_logout(token)
11031103

11041104

1105+
@router.get("/health")
1106+
async def health_check():
1107+
"""Public health check endpoint - no auth required"""
1108+
try:
1109+
stats = await db.get_dashboard_stats()
1110+
has_active_tokens = stats.get("active_tokens", 0) > 0
1111+
except Exception:
1112+
return {"backend_running": True, "has_active_tokens": False}
1113+
return {"backend_running": True, "has_active_tokens": has_active_tokens}
1114+
1115+
11051116
@router.get("/api/stats")
11061117
async def get_stats(token: str = Depends(verify_admin_token)):
11071118
"""Get statistics for dashboard"""

0 commit comments

Comments
 (0)