chore: add health-check api endpoint
Build & Push Docker Image (Backend) / build (push) Successful in 1m50s
Build & Push Docker Image (Backend) / build (push) Successful in 1m50s
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from apps.common.views import HealthCheckView
|
||||
|
||||
urlpatterns = [
|
||||
path("health/", HealthCheckView.as_view(), name="health-check"),
|
||||
]
|
||||
+14
-2
@@ -1,3 +1,15 @@
|
||||
from django.shortcuts import render
|
||||
from rest_framework import status
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
# Create your views here.
|
||||
|
||||
class HealthCheckView(APIView):
|
||||
permission_classes = []
|
||||
authentication_classes = []
|
||||
|
||||
def get(self, request):
|
||||
return Response({
|
||||
'status': 'ok',
|
||||
'service': 'lms-backend'
|
||||
},
|
||||
status=status.HTTP_200_OK)
|
||||
+2
-1
@@ -15,8 +15,9 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', include('apps.common.urls')),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user