G
G
gooseNjuice()2022-02-21 18:01:22
Node.js
gooseNjuice(), 2022-02-21 18:01:22

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?

or at worst
как подключать разные .env в зависимости от того же url?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rag'n' Code Man, 2022-02-22
@iDmitriyWinX

You would also ask how to dynamically change the application code and recompile the sources on the fly :)
Create several .envfiles 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.envandproduction.env

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question