How to run workers on any subdomain?

Hi there!

I have a worker that I'd like to deploy both dev and production versions of to a zone. For simplicities sake, let's say the zone is example.com.

For my production worker, I'd like the worker to listen to every request to any subdomain and path to example.com. To do this, I've added the route
*/*
and this works great.

However, I'd like to try to scope this a little more so that I can add a dev version to this zone too.

What I'd ideally like is for my production worker to handler requests that look like this: *.example.com/*. I'd then like my dev worker to handler requests that look like this: *.dev.example.com/*.

Is this possible? Or should I just look into getting a different domain?

Thanks!
Was this page helpful?