Trying to understand the different ways that you can enter Routes in Cloudflare and getting really confused… Have already read all the Workers documentation and taken Kristian’s excellent Introduction to Cloudflare Workers egghead tutorial, but still not sure.
(Have changed all the names in these following snapshots with Chrome Inspect to protect the innocent. , but changed them consistently).
In these screenshots:
When I log into my dashboard, and just go to my Worker tab right from my User account page, I see this under “Triggers” (yet another new word!):
But when I first navigate to Websites → then pick example.com → Workers, I see this instead:
These routes don’t seem consistent. For a few examples:
- search.foobar.workers.dev doesn’t appear under the one for example.com. Why not?
- *example.com/favicon.ico (I was running into this issue of every hit serving two requests because it was looking for a favicon, so trying to block that route) doesn’t appear on the routes for [email protected]. Why not?
Lastly, in the wrangler.toml file, there is another way to enter routes, like
route = "*example.com/*"
- Is this yet a different way of defining things? I feel like my code is very non-DRY. Does dashboard or .toml file have precedent or override each other?
- In the wrangler.toml file, you can only define one route, but so does that conflict with the ability in the dashboard to have certain additional routes excluded, etc.?
I hope you can understand the confusion to someone who hasn’t worked with these workers before. Thanks so much.