As the title says I want to have an env variable that will change depending on the environment. When I’m developing I want it to have the value of localhost:9000 while when I deploy I want it to assume the value https://quentertain-backend.netlify.app (which is basically the backend of my web app).
I created an issue on github that describes exactly the desired result in code, I am just having trouble with the configuration because the env variable set in the settings of the site doesn’t seem to ovverride what I put in my local .env. Any ways to achieve such convenient behaviour or similar?
Don’t commit the .env file to GitHub, use it locally only. This way when you deploy to Netlify the value environment variable set in the UI will get used.
Thank you so much, it worked! I think that .env was taking priority over gui-set env variable so It was still localhost when deployed. But if there’s no .env in the deploy it can’t be overrided!