I\'m trying to follow a tutorial and it says:
There are a few ways to load credentials.
- Loaded from environment variables,
Like ctrlplusb said, I recommend you to use the package dotenv
, but another way to do this is creating a js file and requiring it on the first line of your app server.
env.js:
process.env.VAR1="Some value"
process.env.VAR2="Another Value"
app.js:
require('env')
console.log(process.env.VAR1) // Some value