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

According to documentation you could use heroku CLI

heroku config:set DATABASE_URI=database_uri_here --app your-app-name
heroku config:set SESSION_SECRET=session_secret --app your-app-name

or you could use UI https://dashboard-classic.heroku.com/apps/{your-app-name}/settings and provide the same variables via web interface, as I mentioned in the above comment

NODE_ENV=production is not treated specially by heroku, so you do need to provide it as well as any other env variable

Leave a Comment

tech