feat: healthcheck endpoint structure
This commit is contained in:
parent
bcdef91dd0
commit
b3ae655009
1 changed files with 13 additions and 3 deletions
14
src/api.py
14
src/api.py
|
|
@ -2,7 +2,7 @@
|
||||||
This module hooks the routers for the main endpoints into a single router for importing to the app.
|
This module hooks the routers for the main endpoints into a single router for importing to the app.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter, status
|
||||||
|
|
||||||
from src.auth.router import router as auth_router
|
from src.auth.router import router as auth_router
|
||||||
from src.contact.router import router as contact_router
|
from src.contact.router import router as contact_router
|
||||||
|
|
@ -11,6 +11,7 @@ from src.user.router import router as user_router
|
||||||
from src.admin.router import router as admin_router
|
from src.admin.router import router as admin_router
|
||||||
from src.iam.router import router as iam_router
|
from src.iam.router import router as iam_router
|
||||||
from src.service.router import router as service_router
|
from src.service.router import router as service_router
|
||||||
|
from src.schemas import CustomBaseModel
|
||||||
|
|
||||||
|
|
||||||
api_router = APIRouter(prefix="/api/v1")
|
api_router = APIRouter(prefix="/api/v1")
|
||||||
|
|
@ -24,7 +25,16 @@ api_router.include_router(service_router)
|
||||||
api_router.include_router(iam_router)
|
api_router.include_router(iam_router)
|
||||||
|
|
||||||
|
|
||||||
@api_router.get("/healthcheck", include_in_schema=False)
|
class HealthCheckResponse(CustomBaseModel):
|
||||||
|
status: str
|
||||||
|
|
||||||
|
|
||||||
|
@api_router.get(
|
||||||
|
path="/healthcheck",
|
||||||
|
status_code=status.HTTP_200_OK,
|
||||||
|
response_model=HealthCheckResponse,
|
||||||
|
include_in_schema=False,
|
||||||
|
)
|
||||||
def healthcheck():
|
def healthcheck():
|
||||||
"""Simple health check endpoint."""
|
"""Simple health check endpoint."""
|
||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue