cloudflare worker route triggers

Is it possible to trigger a worker inversely? So for example.. trigger on all routes except for /api*
4 Replies
Chaika
Chaika16mo ago
You could add example.com/*, Worker: Your_Worker And then another route example.com/api*, Worker: None
crossbeau
crossbeauOP16mo ago
If i had another worker handling example.com/api* would that pick up if i did that?
Chaika
Chaika16mo ago
The more specific route wins, yes: https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior If your question was how to add the Worker: none, in the Cloudflare dashboard, under your website, you can click Worker Routes there, and add that route, ex:
Routes · Cloudflare Workers docs
Routes allow users to map a URL pattern to a Worker. When a request comes in to the Cloudflare network that matches the specified URL pattern, your …
No description
crossbeau
crossbeauOP16mo ago
👍 thank you, that was what i thought and wanted to make sure i read right Then there is something odd about the code that is forcing it to not fire the other worker ill have to look at. Im thinking about how to try to merge the 2
Want results from more Discord servers?
Add your server