Skip to content

Commit

Permalink
Merge pull request #214 from EarthSchlange/add_healthcheck_page
Browse files Browse the repository at this point in the history
Added ApiStatusView for the AGAGD.
  • Loading branch information
Michael Hiiva authored Aug 2, 2021
2 parents 65a5d0c + 13859a7 commit 998d542
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions agagd/agagd/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from agagd_core import urls as beta_urls
from agagd_core.views import core as agagd_views
from agagd_core.views.beta.api import ApiStatusView
from agagd_core.views.core import InformationPageView, QualificationsPageView
from django.conf import settings
from django.conf.urls import include, url
Expand All @@ -8,6 +9,7 @@
from django.views.generic import RedirectView

urlpatterns = [
path("api/status/", ApiStatusView.as_view(), name="api_status_view"),
url(r"^$", agagd_views.index, name="index"),
url(r".php$", RedirectView.as_view(url=reverse_lazy("index"))),
url(r"^search/$", agagd_views.search, name="search"),
Expand Down
4 changes: 3 additions & 1 deletion agagd/agagd_core/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# AGAGD Beta Imports
from agagd_core.views.beta.api import ApiStatusView
from agagd_core.views.beta.core import (
list_all_players,
list_all_tournaments,
Expand All @@ -17,6 +18,7 @@
# fmt: off
beta_patterns = ([
path('', frontpage, name='index'),
path('api/status/', ApiStatusView.as_view(), name='beta_api_status'),
path('players/', list_all_players, name='players_list'),
path('players/<int:player_id>/', players_profile, name='players_profile'),
path('information/', InformationView.as_view(), name='ratings_overview'),
Expand All @@ -25,4 +27,4 @@
path('tournaments/', list_all_tournaments, name='tournaments_list'),
path('tournaments/<slug:code>/', tournament_detail, name='tournament_detail'),
path('qualifications/', QualificationsView.as_view(), name='qualifications_overview')
], 'beta')
], 'beta')
9 changes: 9 additions & 0 deletions agagd/agagd_core/views/beta/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from agagd_core.json_response import JsonResponse
from django.http import HttpResponse
from django.views import View


class ApiStatusView(View):
def get(self, request):
response = {"health_status_code": 200, "health_status": "The AGAGD is running."}
return JsonResponse(response)

0 comments on commit 998d542

Please sign in to comment.