Add worker ping endpoint

This commit is contained in:
Calum Muir 2025-12-22 14:17:19 +00:00
parent f5cd87733c
commit 909a416311

View file

@ -163,6 +163,9 @@ const handleContact = async (request: Request, env: Env) => {
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const url = new URL(request.url);
if (url.pathname === "/__worker_ping") {
return jsonResponse({ ok: true });
}
const contactPath = url.pathname;
const isContact =
contactPath === "/api/contact" ||