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