all repos — website @ 56098880b8dc2f78e5cc9f4e060cf6718fd6f789

My website

Create /health handler

Alan Pearce
commit

56098880b8dc2f78e5cc9f4e060cf6718fd6f789

parent

6c0b9fb5773f48d86008f737704b735c0787e788

4 files changed, 4 insertions(+), 5 deletions(-)

changed files
M bun.lockbbun.lockb

Not showing binary file.

M fly.tomlfly.toml
@@ -26,6 +26,4 @@ grace_period = "10s"
interval = "30s" method = "GET" timeout = "5s" - path = "/health.txt" - [http_service.checks.headers] - Host = "alanpearce.eu" + path = "/health"
M src/app.tssrc/app.ts
@@ -145,7 +145,9 @@ "http.method": request.method,
"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 ) {
D static/health.txt
@@ -1,1 +0,0 @@
-OK