Closed salahelfarissi closed 1 year ago
Thank you @salahelfarissi. Happy to merge this one.
Btw. I'm curious - what are the main advantages of dotenv
? I mean, the way I usually set env. variables is, for example:
Hi @petrbroz.
Recently I was working on integrating APS API into a React App (A monitoring plateform). We have seperate packages: api
, front
, ansible
each having its own .env.example
file.
This practice allows for better versionning, if I added a component related to APS API, I'll add its corresponding env variables along others that already exist (corresponding to db connection, AWS...) to the .env.example file, hence future developpement will concur these new env variables (developpers will be aware of their existence).
With this practice, and with the use of dotenv
, to start developping you only need to:
api
, front
...), type: yarn start
loading the env variables in the cwd
without starting debugging mode.Got it, thank you @salahelfarissi! Sounds like I should consider using dotenv
in my other samples as well :)
This PR aims to use dotenv to import env variables.