loading...

re: Loading environment variables in JS apps VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi there, nice article. Just have a quick question. Does the dotenv script load the entire .env file into the client side? If that's the case t...
 

This might be silly but I was wondering exactly the same thing. If you can do console.log(process.env); I wonder if the values are automatically replaced by environment variables perhaps?

--EDIT--
I went ahead and read the link to the 12-factor app and this is exactly what happens. The values are replaced by environment variables with each deploy.

The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard. - The Twelve-factor App

 

Very cool. Thanks for taking the time to answer.

Code of Conduct Report abuse