aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/index.py
blob: 81447237a0d26efdda1f4c185577934db27a9731 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Index route for the forms API.
"""
from starlette.requests import Request
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: Request) -> JSONResponse:
        return JSONResponse({
            "message": "Hello, world!",
            "client": request.client.host
        })