Skip to content

Commit

Permalink
add health-check route
Browse files Browse the repository at this point in the history
  • Loading branch information
poysa213 committed Jun 7, 2024
1 parent 82b6120 commit afe5d4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from django.contrib import admin
from django.urls import path, include

from .views import HealthCheckView

from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView

urlpatterns = [
Expand All @@ -25,6 +27,7 @@
path('api/teachers/', include("teachers.api.urls")),
path('api/', include("students.api.urls")),
path('api/evaluations/', include("evaluations.urls")),
path('health-check', HealthCheckView.as_view(), name='health-check'),
# open api schema
# YOUR PATTERNS
path('api/schema/', SpectacularAPIView.as_view(), name='schema'),
Expand Down
10 changes: 10 additions & 0 deletions core/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status

class HealthCheckView(APIView):
def get(self, request):
data = {
"message": "Welcome to staff service"
}
return Response(data, status=status.HTTP_200_OK)

0 comments on commit afe5d4f

Please sign in to comment.