diff --git a/app/api/endpoints/health.py b/app/api/endpoints/health.py index f9ba1a8..81b3e91 100644 --- a/app/api/endpoints/health.py +++ b/app/api/endpoints/health.py @@ -1,15 +1,11 @@ -from fastapi import APIRouter, Depends -from sqlalchemy.orm import Session - -from app.db.session import get_db +from fastapi import APIRouter router = APIRouter() @router.get("", summary="Health check endpoint") -def health_check(db: Session = Depends(get_db)): +def health_check(): """ Health check endpoint that verifies the application is running - and database connection is working """ return {"status": "ok", "message": "Todo API is running"} \ No newline at end of file diff --git a/main.py b/main.py index ad99045..b869736 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,15 @@ if settings.BACKEND_CORS_ORIGINS: allow_headers=["*"], ) +# Root-level health check endpoint +@app.get("/health", tags=["health"]) +async def root_health_check(): + """ + Root-level health check endpoint that verifies the application is running. + This endpoint is used by monitoring systems to check if the service is alive. + """ + return {"status": "ok", "message": "Todo API is running"} + app.include_router(api_router, prefix=settings.API_V1_STR) if __name__ == "__main__":