Skip to content

Commit

Permalink
Add a light weight dedicated healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Nov 14, 2023
1 parent 11888d9 commit 12b267c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.contrib import admin
from django.views import defaults
from django.views import static as static_views
from django.http import JsonResponse

from rest_framework import permissions
from drf_yasg.views import get_schema_view
Expand Down Expand Up @@ -58,10 +59,15 @@
permission_classes=(permissions.AllowAny,),
)

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

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

path('health', health_check),

# api docs
re_path(
r'^swagger(?P<format>\.json|\.yaml)$',
Expand Down

0 comments on commit 12b267c

Please sign in to comment.