18 lines
374 B
Python
18 lines
374 B
Python
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"}
|