Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move /health endpoint to /api/v1/health (making it public) #716

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.views import defaults
from django.views import static as static_views
from django.http import JsonResponse
from django.shortcuts import redirect

from rest_framework import permissions
from drf_yasg.views import get_schema_view
Expand Down Expand Up @@ -59,14 +60,18 @@
permission_classes=(permissions.AllowAny,),
)

def health_redirect(request):
return redirect(API_BASE_URL + 'health')

def health_check(request):
return JsonResponse({'status': 'ok'})

urlpatterns += [
# Django Admin
path('admin/', admin.site.urls),

path('health', health_check),
path('health', health_redirect),
path(API_BASE_URL + 'health', health_check),

# api docs
re_path(
Expand Down
Loading