template-test1/app/modules/sys/routes.py
2025-11-12 07:33:43 +00:00

41 lines
1.3 KiB
Python

from fastapi import APIRouter, status
from starlette.responses import JSONResponse
from app.utils.config import settings
from app.schema import Response
router = APIRouter()
@router.get('/_/livez', status_code=status.HTTP_200_OK, response_model=Response)
async def liveness() -> JSONResponse:
"""
Liveness check probe endpoint.
You can modify the logic here to check the health of your application.
But do not modify the response format or remove this endpoint.
Its will break the health check of the deployment.
"""
return JSONResponse(
status_code=status.HTTP_200_OK,
content={
'code': status.HTTP_200_OK,
'msg': 'ok',
'payload': None
}
)
@router.get('/_/readyz', status_code=status.HTTP_200_OK, response_model=Response)
async def readiness() -> JSONResponse:
"""
Readiness check probe endpoint.
You can modify the logic here to check the health of your application.
But do not modify the response format or remove this endpoint.
Its will break the health check of the deployment.
"""
return JSONResponse(
status_code=status.HTTP_200_OK,
content={
'code': status.HTTP_200_OK,
'msg': 'ok',
'payload': None
}
)