Closed MexHigh closed 1 year ago
// 404 for everything else
router.all('*', () => new Response('Not Found.', { status: 404 }))
// 404 for everything else router.all('*', () => new Response('Not Found.', { status: 404 }))
Yeah, that request for the favicon.ico
is certainly triggering that, but it appears to also be on the 200... I'll look into this one!
In addition to the catchall 404 at the end mentioned above, I often have something like this toward the top of my router worker:
const HT_NC= {status: 204};
.get('/favicon.ico', ()=> {
return new Response(null, HT_NC)
})
Of course, you could also return a valid icon if you prefer.
Closing this as answered!
I've tried using this minimal example mentioned in the README file:
But when running
wrangler dev
and hitting the/
route, the console shows this error:However, the route returns the correct result "Test".
How do I get rid of these errors?