14 lines
317 B
Python
14 lines
317 B
Python
|
|
from fastapi import APIRouter, Depends
|
||
|
|
from sqlalchemy import text
|
||
|
|
from sqlalchemy.orm import Session
|
||
|
|
|
||
|
|
from app.db import get_db
|
||
|
|
|
||
|
|
router = APIRouter(tags=["health"])
|
||
|
|
|
||
|
|
|
||
|
|
@router.get("/healthz")
|
||
|
|
def healthz(db: Session = Depends(get_db)) -> dict:
|
||
|
|
db.execute(text("SELECT 1"))
|
||
|
|
return {"status": "ok", "db": "ok"}
|