From 2bd974bec5bdec1597a60a1e4f25554c629126a0 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Fri, 15 Nov 2024 11:53:55 +0000 Subject: [PATCH] fix: health check path --- codeforlife/urls/patterns.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/codeforlife/urls/patterns.py b/codeforlife/urls/patterns.py index cce82d4..f407ae6 100644 --- a/codeforlife/urls/patterns.py +++ b/codeforlife/urls/patterns.py @@ -36,11 +36,6 @@ def get_urlpatterns( admin.site.urls, name="admin", ), - path( - "health-check/", - HealthCheckView.as_view(), - name="health-check", - ), path( "api/csrf/cookie/", CsrfCookieView.as_view(), @@ -80,10 +75,18 @@ def get_urlpatterns( ) ) + health_check_path = path( + "health-check/", + HealthCheckView.as_view(), + name="health-check", + ) + if SERVICE_IS_ROOT: + urlpatterns.append(health_check_path) return urlpatterns return [ + health_check_path, path( f"{SERVICE_NAME}/", include(urlpatterns),