From 6808ab467b2803842ee07d27d6d019011d3e74ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Gilli=C3=9Fen?= Date: Mon, 22 Sep 2025 14:56:56 +0200 Subject: [PATCH] feat: add health check endpoint /health for monitoring --- app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app.py b/app.py index 20e5542..e23b816 100644 --- a/app.py +++ b/app.py @@ -321,3 +321,14 @@ async def get_not_in_mb( ) _inject_cache_headers(response.headers) return response + + +@app.get("/health") +async def get_health( + request: Request, + beets_statistics: Annotated[BeetsStatistics, Depends(get_beets_statistics)], +): + response = { + "database": "ok" if beets_statistics.connection else "no connection", + } + return response