diff --git a/src/endpoints.py b/src/endpoints.py index 3ff95b4..824b590 100644 --- a/src/endpoints.py +++ b/src/endpoints.py @@ -8,6 +8,7 @@ from sbase import BaseCase from src.consts import CHALLENGE_TITLES from src.models import ( + HealthcheckResponse, LinkRequest, LinkResponse, Solution, @@ -41,7 +42,7 @@ def health_check(sb: SeleniumDep): detail="Health check failed", ) - return {"status": "ok"} + return HealthcheckResponse(user_agent=sb.get_user_agent()) @router.post("/v1") diff --git a/src/models.py b/src/models.py index ef48104..89df416 100644 --- a/src/models.py +++ b/src/models.py @@ -19,6 +19,13 @@ class LinkRequest(BaseModel): max_timeout: int = Field(default=60) +class HealthcheckResponse(BaseModel): + model_config = {"alias_generator": to_camel, "populate_by_name": True} + msg: str = "Byparr is ready!" + version: str = consts.VERSION + user_agent: str + + class Solution(BaseModel): url: str status: int