From 809231a41e6422f8ab4f9ff6d8817d919c2b8dc0 Mon Sep 17 00:00:00 2001 From: Kanishk Pachauri Date: Thu, 19 Oct 2023 20:22:07 +0530 Subject: [PATCH] [feat]: Added health route --- bloom/api.py | 3 +++ bloom/health/__init__.py | 0 bloom/health/endpoints.py | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 bloom/health/__init__.py create mode 100644 bloom/health/endpoints.py diff --git a/bloom/api.py b/bloom/api.py index 3bee442..bfeef83 100644 --- a/bloom/api.py +++ b/bloom/api.py @@ -2,9 +2,12 @@ from .auth.endpoints import router as auth_router from .user.endpoints import router as user_router +from .health.endpoints import router as health_router router = APIRouter(prefix="/api/v1") +router.include_router(health_router) + router.include_router(auth_router) router.include_router(user_router) diff --git a/bloom/health/__init__.py b/bloom/health/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bloom/health/endpoints.py b/bloom/health/endpoints.py new file mode 100644 index 0000000..07fa904 --- /dev/null +++ b/bloom/health/endpoints.py @@ -0,0 +1,13 @@ +from fastapi import APIRouter + +router = APIRouter(tags=["health"]) + + +@router.get("/healthz") +async def healthz() -> dict[str, str]: + return {"status": "ok"} + + +@router.get("/readyz") +async def readyz() -> dict[str, str]: + return {"status": "ok"}