diff options
author | 2020-10-25 19:50:43 +0000 | |
---|---|---|
committer | 2020-10-25 19:50:43 +0000 | |
commit | 176a012f4b70cfb89c93af954a410afc86e42835 (patch) | |
tree | 2fb08d74ea238ad224069d299812d708af86edbe /backend/routes/index.py | |
parent | Add route class and route manager for dynamic route loading (diff) |
Add some basic routes
Diffstat (limited to 'backend/routes/index.py')
-rw-r--r-- | backend/routes/index.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/backend/routes/index.py b/backend/routes/index.py new file mode 100644 index 0000000..1b5b404 --- /dev/null +++ b/backend/routes/index.py @@ -0,0 +1,24 @@ +""" +Index route for the forms API. +""" + +from starlette.responses import JSONResponse + +from backend.route import Route + + +class IndexRoute(Route): + """ + Return a generic hello world message with some information to the client. + + Can be used as a healthcheck for Kubernetes or a frontend connection check. + """ + + name = "index" + path = "/" + + def get(self, request): + return JSONResponse({ + "message": "Hello, world!", + "client": request.client.host + }) |