Create /health handler
3 files changed, 4 insertions(+), 4 deletions(-)
jump to
M src/app.ts → src/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 ) {