all repos — homestead @ 31ae15a24fc8f174f5880fd35ec28c6482a898ad

Code for my website

Create /health handler

Alan Pearce
commit

31ae15a24fc8f174f5880fd35ec28c6482a898ad

parent

a9895359056220647d864a0cb3a121d95e173a22

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

jump to
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 ) {