diff --git a/core/urls.py b/core/urls.py index 01eb1dc..86d1f78 100644 --- a/core/urls.py +++ b/core/urls.py @@ -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 = [ @@ -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'), diff --git a/core/views.py b/core/views.py new file mode 100644 index 0000000..85ef5c4 --- /dev/null +++ b/core/views.py @@ -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)