Skip to content

Commit

Permalink
refactor: change URL format
Browse files Browse the repository at this point in the history
  • Loading branch information
hartungstenio committed Jan 24, 2025
1 parent ce40bdf commit 23ab6ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/django_healthy/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
app_name = "django_healthy"

urlpatterns = [
path("ping/", LivenessView.as_view(), name="ping"),
path("health/", HealthView.as_view(), name="health"),
path("", HealthView.as_view(), name="health"),
path("alive/", LivenessView.as_view(), name="ping"),
]
4 changes: 2 additions & 2 deletions src/django_healthy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.template.response import TemplateResponse
from django.views import View

from .health_checks import HealthReport, health_check_service
from .health_checks import HealthReport, HealthStatus, health_check_service


class LivenessView(View):
Expand All @@ -18,7 +18,7 @@ class LivenessView(View):
]

async def get(self, request: HttpRequest) -> HttpResponse: # noqa: ARG002
return HttpResponse("Pong")
return HttpResponse(HealthStatus.PASS, content_type="text/plain")


class HealthView(View):
Expand Down
2 changes: 1 addition & 1 deletion testproj/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import include, path

urlpatterns = [
path("", include("django_healthy.urls", namespace="django_healthy")),
path("health/", include("django_healthy.urls", namespace="django_healthy")),
]

0 comments on commit 23ab6ea

Please sign in to comment.