I am unable to convince myself that my worker is being hit.
Specifically, I did this:
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
throw new Error(“break”)
…
}
and I cannot get a failure to occur when I hit a matching route.
Where can I see a log of some sort to prove that my worker is or is not being invoked?
sandro
2
return new Response('Hi from your Worker');
should cover that.
$ wrangler tail
. You’ll need to have cloudflared
installed. More details here
sandro
4
Wrangler is an option but you neither need wrangler nor cloudflared to check if your Worker is running. The above example will quickly show that.
system
Closed
5
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.