From 57e2b3e73e9cf2ce01f7fc7baed476807342a162 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Wed, 21 Dec 2022 11:32:24 +0100 Subject: Added an healthcheck endpoint --- ttun_server/endpoints.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ttun_server/endpoints.py') diff --git a/ttun_server/endpoints.py b/ttun_server/endpoints.py index 5b9e57f..b62313c 100644 --- a/ttun_server/endpoints.py +++ b/ttun_server/endpoints.py @@ -48,6 +48,14 @@ class Proxy(HTTPEndpoint): await response(self.scope, self.receive, self.send) +class Health(HTTPEndpoint): + async def get(self) -> None: + response = Response(content='OK', status_code=200) + + await response(self.scope, self.receive, self.send) + + + class Tunnel(WebSocketEndpoint): encoding = 'json' -- cgit v1.2.3 From 324f7692e790e53ecc52a22c0df9372c1ae95930 Mon Sep 17 00:00:00 2001 From: Sernin van de Krol Date: Wed, 21 Dec 2022 12:11:10 +0100 Subject: Add unused parameter to get method --- ttun_server/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ttun_server/endpoints.py') diff --git a/ttun_server/endpoints.py b/ttun_server/endpoints.py index b62313c..2b92b76 100644 --- a/ttun_server/endpoints.py +++ b/ttun_server/endpoints.py @@ -49,7 +49,7 @@ class Proxy(HTTPEndpoint): class Health(HTTPEndpoint): - async def get(self) -> None: + async def get(self, _) -> None: response = Response(content='OK', status_code=200) await response(self.scope, self.receive, self.send) -- cgit v1.2.3