In the new CF Workers - how do I enable
In the new CF Workers - how do I enable preview within the same Worker? Is it as simple as setting
"preview_urls": true, in my wrangler.jsonc?
Ok if that's that easy then how do I set up environment variables specific to each env: preview and ... prod?4 Replies
you'll want to use wrangler environments for this. you'll set up your non production deploy endpoint to do a versions upload pointing to your env (eg. wrangler versions upload --env staging)
Ok, is there a tutorial...or example of this on Github? I can look myself, just wondering if you knew
I'll start looking up this stuff via your MCP, maybe I find a path
for reference this is my config for testing purposes:
and I push as:
but this creates 2 workers
So you'll need two Workers to manage 2 sets of bindings. there's not a 1:1 equivalent like we have in Pages
Wrangler config looks fine, you'll want to configure your production worker's non preview url (in dash) to be using --env staging
Shouldnt need to configure anything directly on your staging worker
GOT IT