Extracting Heroku app configuration to .env file

This is useful to debug your app using the same environment variable of your running Heroku app.

Requirements

  • Heroku cli installed
  • Heroku cli properly configured

Just run this in you project root (Or where the .env file is):

$ heroku config -a your-application-name -s | tee .env

The .env file will be overwritten with your Heroku app settings.

Now you can debug you app running on you workstation.