Files
mtusi2026lab7/app/endpoints/health.py
T
gytall 0b97f77d76
Skeleton contracts / contracts (pull_request) Canceled after 0s
skeleton lab7 and tasks for grade 3
2026-11-21 16:21:47 +03:00

24 lines
525 B
Python

from fastapi import APIRouter, Request
from app.domain import health
from app.schemas.base import Health
router = APIRouter(prefix="/health", tags=["health"])
@router.get("/live")
async def liveness() -> Health:
return health.liveness()
@router.get("/ready")
async def readiness(request: Request) -> Health:
state = request.app.state
return await health.readiness(
state.engine,
state.redis,
state.s3,
state.lifecycle,
state.settings.readiness_timeout_seconds,
)