Files
mtusi2026lab2/src/messenger/shared/entrypoints/health.py
T

20 lines
481 B
Python

from dishka.integrations.fastapi import FromDishka, inject
from fastapi import APIRouter
from messenger.shared.application.ports import Readiness
from messenger.shared.entrypoints.schemas import HealthOut
router = APIRouter(tags=["health"])
@router.get("/health/live")
async def live() -> HealthOut:
return HealthOut()
@router.get("/health/ready")
@inject
async def ready(readiness: FromDishka[Readiness]) -> HealthOut:
await readiness.check()
return HealthOut()