Init first files
This commit is contained in:
17
backend/app/api/routes/health.py
Normal file
17
backend/app/api/routes/health.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from fastapi import APIRouter
|
||||
from sqlalchemy import text
|
||||
from app.core.db import SessionLocal
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/healthz")
|
||||
async def healthz() -> dict:
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@router.get("/readyz")
|
||||
async def readyz() -> dict:
|
||||
async with SessionLocal() as session:
|
||||
await session.execute(text("SELECT 1"))
|
||||
return {"status": "ready"}
|
||||
Reference in New Issue
Block a user