Sunday, 4 June 2017

Alternative to access environment variables in Node.js

I'm trying to store production db and email passwords on environment variables to hide to GitHub users.

I set up my vars using export command on terminal:

$ export DB_PASS=mydbpass

But I can't access via process.env.DB_PASS

I'm not sure this is the correct. I saw that is possible to access by running:

DB_PASS=mydbpass node server.js

But I'm looking for a more practical way to do this.



via Diego Machado

No comments:

Post a Comment