aboutsummaryrefslogtreecommitdiffstats
path: root/api/views.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-16 20:54:01 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-16 20:54:01 +0200
commit9766d41be89a6889b3c99af890f362e18f57d391 (patch)
tree9aa20328d1f374a49e8363e1efa3fc5cd2634900 /api/views.py
parentSmall documentation fixes. (diff)
Add a `HealthcheckView`.
Diffstat (limited to 'api/views.py')
-rw-r--r--api/views.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/api/views.py b/api/views.py
new file mode 100644
index 00000000..dbc04b56
--- /dev/null
+++ b/api/views.py
@@ -0,0 +1,27 @@
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+
+class HealthcheckView(APIView):
+ """
+ Provides a simple view to check that the website is alive and well.
+
+ ## Routes
+ ### GET /healthcheck
+ Returns a simple JSON document showcasing whether the system is working:
+
+ >>> {
+ ... 'status': 'ok'
+ ... }
+
+ Seems to be.
+
+ ## Authentication
+ Does not require any authentication nor permissions..
+ """
+
+ authentication_classes = ()
+ permission_classes = ()
+
+ def get(self, request, format=None):
+ return Response({'status': 'ok'})