Search code examples
expressherokudotenv

express published to heroku but requires .env


A while back I set up a heroku app for my express.js API. I set this up so that when I push to GitHub it automatically deploys to heroku. All works fine except for one thing, my secrets. I store them I a .env file and all works fine. Only problem is because they are in my .gitignore they are not pushed to the repo which causes my heroku app to malfunction. This might be a duplicate but I can't find my answer. I would appreciate your help. Thanks in advance!


Solution

  • assuming you checked out this stackoverflow question i would make it a bit simpler by laying out the steps as so:

    • head on to your project dashboard
    • go to settings tab from the upper menu
    • scroll down to config vars and show them

    you will find the config input where you can place all your dotenv secrets and it would look like this enter image description here