Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5054

How to set environment variables on Heroku for Node app and connect to the PostgreSQL database?

$
0
0

I know there are the same/similar questions on stack overflow and I have read the documentation too-I just still don't understand ANYTHING- how to set those variables and WHERE!! to set them.

My env/production.js file:

module.exports = {"DATABASE_URI": process.env.DATABASE_URI,"SESSION_SECRET": process.env.SESSION_SECRET,"TWITTER": {"consumerKey": process.env.TWITTER_CONSUMER_KEY,"consumerSecret": process.env.TWITTER_CONSUMER_SECRET,"callbackUrl": process.env.TWITTER_CALLBACK    },"FACEBOOK": {"clientID": process.env.FACEBOOK_APP_ID,"clientSecret": process.env.FACEBOOK_CLIENT_SECRET,"callbackURL": process.env.FACEBOOK_CALLBACK_URL    },"GOOGLE": {"clientID": process.env.GOOGLE_CLIENT_ID,"clientSecret": process.env.GOOGLE_CLIENT_SECRET,"callbackURL": process.env.GOOGLE_CALLBACK_URL    },"LOGGING": true};

In my env/development.js file I set the variables (linked to my PostgreSQL/localhost/xxx). Do I need to set them in Heroku for all (Google, Facebook etc.) or just for the database, since I had to create one with Heroku? Do I leave the link to my local database in my development file and link to the Heroku database separately?

I don't even know if I am supposed to do it from my command line?! In the documentation it says: Heroku config:get CONFIG-VAR-NAME -s >> .envso would it be Heroku config:get CONFIG-NAME OF MY HEROKU DATABASE -s >> .env ?

I'm deploying for the first time and so confused! Help :)


Viewing all articles
Browse latest Browse all 5054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>