diff options
author | 2018-08-16 20:54:01 +0200 | |
---|---|---|
committer | 2018-08-16 20:54:01 +0200 | |
commit | 9766d41be89a6889b3c99af890f362e18f57d391 (patch) | |
tree | 9aa20328d1f374a49e8363e1efa3fc5cd2634900 /api/views.py | |
parent | Small documentation fixes. (diff) |
Add a `HealthcheckView`.
Diffstat (limited to 'api/views.py')
-rw-r--r-- | api/views.py | 27 |
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'}) |