all repos — website @ 56098880b8dc2f78e5cc9f4e060cf6718fd6f789

My website

Create /health handler

Alan Pearce
commit

56098880b8dc2f78e5cc9f4e060cf6718fd6f789

parent

6c0b9fb5773f48d86008f737704b735c0787e788

1 file changed, 3 insertions(+), 1 deletion(-)

changed files
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 ) {