From 56098880b8dc2f78e5cc9f4e060cf6718fd6f789 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 8 Nov 2023 07:36:48 +0100 Subject: Create /health handler --- src/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/app.ts') diff --git a/src/app.ts b/src/app.ts index 8ba2d8a..7250a62 100644 --- a/src/app.ts +++ b/src/app.ts @@ -145,7 +145,9 @@ export const server = { "http.user_agent": request.headers.get("user-agent"), }, }); - if ( + if (pathname === "/health") { + return new Response("OK", { status: 200 }); + } else if ( config.redirect_other_hostnames && request.headers.get("host") !== expectedHostURL.host ) { -- cgit 1.4.1