Add contact debug endpoint

This commit is contained in:
Calum Muir 2025-12-22 13:51:56 +00:00
parent 0cfe7522fd
commit cbbd6debbd

View file

@ -175,6 +175,17 @@ export default {
} }
return handleContact(request, env); return handleContact(request, env);
} }
if (url.pathname === "/api/contact-debug") {
return jsonResponse({
ok: true,
hasTurnstileSecret: Boolean(env.TURNSTILE_SECRET_KEY),
hasAzureConnectionString: Boolean(
env.AZURE_COMMUNICATION_CONNECTION_STRING,
),
hasContactFromEmail: Boolean(env.CONTACT_FROM_EMAIL),
hasContactToEmail: Boolean(env.CONTACT_TO_EMAIL),
});
}
if (env.ASSETS?.fetch) { if (env.ASSETS?.fetch) {
return env.ASSETS.fetch(request); return env.ASSETS.fetch(request);
} }