So, key thing here: There is a difference between Routes used by `itty-router`, and Routes as defin

So, key thing here: There is a difference between Routes used by itty-router, and Routes as defined in the Cloudflare Dashboard/wrangler.toml. Routes defined in the Cloudflare Dashboard are applied to all zones in an Account. So, for example, if you have a route that maps to ex.amp.le/*, then the Worker assigned to that route will handle all of the routes that hit ex.amp.le and ex.amp.le/hello, and so on. Routes defined in itty-router are a little bit different, as they handle routes within a Worker. This means that if there isn't a Route/Custom Domain pointing to that Worker, it will not be fired, even if that Route is defined with itty. Thus, if you want your itty-router to respond to requests on /u2f/v1, then you need to both define it in your router like you did:
const router = Router({
base: '/u2f/v1',
});
const router = Router({
base: '/u2f/v1',
});
, and add either a Custom Domain pointing to your Worker(ex.amp.le), or a Route in the Dashboard/your wrangler.toml that matches that base: ex.amp.le/u2f/v1/*, and then you should be good to go.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?