From ac21bbaeec1690593bc095925acd4ca1f0507c6b Mon Sep 17 00:00:00 2001 From: Minkyu Lee Date: Sat, 6 Jul 2024 21:33:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=97=AC=EC=8A=A4=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=20API=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waffledotcom/src/apps/health/__init__.py | 3 +++ waffledotcom/src/apps/health/views.py | 9 +++++++++ waffledotcom/src/apps/router.py | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 waffledotcom/src/apps/health/__init__.py create mode 100644 waffledotcom/src/apps/health/views.py 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)