DEV Community

Discussion on: Bulletproof node.js project architecture 🛡️

Collapse
 
jaymoretti profile image
Jay Moretti

Great write up.
For env variables that are injected in other ways (via CI or Lambda) you could move the dotenv line to run when you start your node app:

"node -r dotenv/config --inspect app"

That will avoid failing to load the .env file when it's only present in one of your environments (local).