Skip to content

Commit

Permalink
feat: adding health check
Browse files Browse the repository at this point in the history
  • Loading branch information
leoisl committed Apr 30, 2024
1 parent 6642c6c commit e16ed2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions hello/echo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ def get_message(request, id):
def get_all_messages(request):
all_messages = list(Message.objects.all().values('id', 'message'))
return JsonResponse(all_messages, safe=False)


def health(request):
return HttpResponse()
3 changes: 2 additions & 1 deletion hello/echo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
path('api/get_message/<int:id>/', api.get_message, name="get_message"),
path('api/get_all_messages/', api.get_all_messages, name="get_all_messages"),
path('api/add_message/', api.AddMessage.as_view(), name="add_message"),
path('api/edit_message/', api.EditMessage.as_view(), name="edit_message")
path('api/edit_message/', api.EditMessage.as_view(), name="edit_message"),
path('api/health', api.health, name="health")
]

0 comments on commit e16ed2d

Please sign in to comment.