Confused about prod workers environment variables
possible noob question as I'm super new to CF using it for a side project (https://vaella.glamboyosa.xyz) and environment variables and CF workers but.
say I have an environment variable in my dev.vars called database_id
and in the [vars] I reference database_id as database_id=$database_id
and also for environment.development
and it all works fine.
but how would I reference environment variables for production that way?
I am aware you could set up a GitHub action but I don't want to or need to so early. and I'd like to commit my wrangler.toml file with my sensitive data secure.
so kinda like on the Vercel dashboard where you can specify environment variables and it'll be read for prod deploys.
like I wanna be able to tell D1 to reference the database_id variable and it kinda point to the var in prod somehow when I use wrangler.
same for using wrangler deploy ...
Vaella
Private Audio Rant Rooms
2 Replies
You would probably want a Secret
Commands - Wrangler · Cloudflare Workers docs
Create, develop, and deploy your Cloudflare Workers with Wrangler commands.
thank you. will check out the docs