Answer the question
In order to leave comments, you need to log in
How to change the values of .env variables depending on the URL where the application is launched?
There is a react application that can run on three different urls, depending on whether it is production, development or UAT. How to change the values of variables in the .env file depending on which url the application is running on?
Answer the question
In order to leave comments, you need to log in
You would also ask how to dynamically change the application code and recompile the sources on the fly :)
Create several .env
files with the necessary parameters and use different parameters depending on the environment.
The most popular way is to use the NODE_ENV environment variable, and name the files development.env
andproduction.env
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question