Add worker ping endpoint
This commit is contained in:
parent
f5cd87733c
commit
909a416311
1 changed files with 3 additions and 0 deletions
|
|
@ -163,6 +163,9 @@ const handleContact = async (request: Request, env: Env) => {
|
||||||
export default {
|
export default {
|
||||||
async fetch(request: Request, env: Env): Promise<Response> {
|
async fetch(request: Request, env: Env): Promise<Response> {
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
|
if (url.pathname === "/__worker_ping") {
|
||||||
|
return jsonResponse({ ok: true });
|
||||||
|
}
|
||||||
const contactPath = url.pathname;
|
const contactPath = url.pathname;
|
||||||
const isContact =
|
const isContact =
|
||||||
contactPath === "/api/contact" ||
|
contactPath === "/api/contact" ||
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue