Files
NexaPG/backend/app/api/routes/health.py
2026-02-12 09:09:13 +01:00

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"}