- Install dotenv
npm i dotenv - Create
.envfile and your variables inside -
Add the script to execute
"dev": "nodemon -r dotenv/config ./app/index.js " or "start": "node -r dotenv/config ./app/index.js " -
Run the app using
npm run devornpm run start