Routes to assign workers domain+subdomain mix

Hi,

I was reading this page on routes and was hoping if someone could confirm if my understanding is correct.

Using the UI above, I should be able to add routes for the following configurations, is that correct?

example.com → worker1.example.workers.dev
product1.example.com → worker2.example.workers.dev
product2.example.com → worker3.example.workers.dev

Does this I do not need to add the following configuration to wrangler.toml?

[env.production]
zone_id = "$yourZoneId"
route = "example.com/*"

Thanks!

In the image, you match all subdomains and all paths to have no Worker firing.

For what you described you’d need 3 routes:
example.com/*Worker1
product1.example.com/*Worker2
product2.example.com/*Worker3

Or in wrangler.toml you could add the route for each worker.
Worker1:
route = "example.com/*

Worker2:
route = "product1.example.com/*

Worker3:
route = "product2.example.com/*

1 Like

Awesome. Thanks for clarifying, @Walshy!