chore: add health-check api endpoint
Build & Push Docker Image (Backend) / build (push) Successful in 1m50s

This commit is contained in:
Flook
2026-04-26 14:23:13 +07:00
parent 40b49acfdb
commit 34e0fa8d71
3 changed files with 23 additions and 3 deletions
+7
View File
@@ -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
View File
@@ -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
View File
@@ -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')),
]