diff options
author | Alan Pearce | 2023-11-08 07:36:48 +0100 |
---|---|---|
committer | Alan Pearce | 2023-11-08 07:36:48 +0100 |
commit | 56098880b8dc2f78e5cc9f4e060cf6718fd6f789 (patch) | |
tree | f9f22d9068942becf254e5509f656f58a99ae526 /src | |
parent | 6c0b9fb5773f48d86008f737704b735c0787e788 (diff) | |
download | website-56098880b8dc2f78e5cc9f4e060cf6718fd6f789.tar.lz website-56098880b8dc2f78e5cc9f4e060cf6718fd6f789.tar.zst website-56098880b8dc2f78e5cc9f4e060cf6718fd6f789.zip |
Create /health handler
Diffstat (limited to 'src')
-rw-r--r-- | src/app.ts | 4 |
1 files changed, 3 insertions, 1 deletions
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 ) { |