Custom Hostname with Worker Environment
Hey folks, how can I use different worker environment with custom hostname setup. As far as I understand we can use a single fallback origin. What's the best way using different workers such as dev, staging and production for a custom domain?
4 Replies
From what I have been able to gather, coming from Pages where each branch was given it's own unique url, set up a worker for each branch and then point the domain to the worker.dev domain.
your branches can be auto deployed to a preview url, but each deploy is a new preview url
so that automagical stuff doesn't work with workers it seems
MAYBE there is an answer lying in environment variables
but I'm only like a day into this stuff, learning to solve the same problem too
https://developers.cloudflare.com/workers/wrangler/environments/
i have that bookmarked, but I havent figured out if it will help me yet
Thanks! Let me know if you can figure it out 🤜
I was honestly hoping someone else would chime in by now...
guess we're on our own