diff --git a/waffledotcom/src/apps/health/__init__.py b/waffledotcom/src/apps/health/__init__.py new file mode 100644 index 0000000..7b624d4 --- /dev/null +++ b/waffledotcom/src/apps/health/__init__.py @@ -0,0 +1,3 @@ +from .views import v1_router as router + +__all__ = ["router"] diff --git a/waffledotcom/src/apps/health/views.py b/waffledotcom/src/apps/health/views.py new file mode 100644 index 0000000..af2fccf --- /dev/null +++ b/waffledotcom/src/apps/health/views.py @@ -0,0 +1,9 @@ +from fastapi import APIRouter + +v1_router = APIRouter(prefix="/v1/health", tags=["batch"]) + + +@v1_router.get("/") +def health_check(): + # 현재로서는 추가로 체크할 게 없으므로 서버만 살아있는지 확인 + return {"status": "OK"} diff --git a/waffledotcom/src/apps/router.py b/waffledotcom/src/apps/router.py index cc51efd..e9c1f48 100644 --- a/waffledotcom/src/apps/router.py +++ b/waffledotcom/src/apps/router.py @@ -1,7 +1,8 @@ from fastapi.routing import APIRouter -from waffledotcom.src.apps import batch, user +from waffledotcom.src.apps import batch, health, user api_router = APIRouter(prefix="/api") api_router.include_router(user.router) api_router.include_router(batch.router) +api_router.include_router(health.router)