From 9a28e52a9641bcbd15ac86b842f71cac1ea28678 Mon Sep 17 00:00:00 2001 From: Esubalew Amenu <54699823+EsubalewAmenu@users.noreply.github.com> Date: Sat, 30 Nov 2024 18:10:01 +0300 Subject: [PATCH] health check endpoint added --- .github/workflows/aws.yml | 4 ---- apps/core/views.py | 6 ++++++ telelbirds/urls.py | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index a949304..dc4eb06 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -103,10 +103,6 @@ jobs: sed -i 's|REPLACE_ME_IPFS_BLOCKFROST|${{ secrets.IPFS_BLOCKFROST }}|g' .aws/task-definition.json - - name: Debug Task Definition - run: | - cat .aws/task-definition.json - - name: Fill in the new image ID in the Amazon ECS task definition id: task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 diff --git a/apps/core/views.py b/apps/core/views.py index 83ecbac..a08a8c2 100644 --- a/apps/core/views.py +++ b/apps/core/views.py @@ -17,6 +17,12 @@ from .forms import ContactForm +from django.http import JsonResponse + +def health_check(request): + return JsonResponse({"status": "healthy"}, status=200) + + logger = logging.getLogger(__name__) diff --git a/telelbirds/urls.py b/telelbirds/urls.py index c7edb4d..2405f48 100644 --- a/telelbirds/urls.py +++ b/telelbirds/urls.py @@ -26,9 +26,11 @@ from apps.customer import urls as CustomerUrls from apps.chicks import urls as ChicksUrls from apps.inventory import urls as InventoryUrls +from apps.core.views import health_check urlpatterns = [ path('admin/', admin.site.urls), + path('health/', health_check), path('', include(BreederUrls)), path('', include(HatcheryUrls)), path('', include(CustomerUrls)),