Home > Net >  node.js application working locally, not on Heroku deploy
node.js application working locally, not on Heroku deploy

Time:10-05

I am attempted to deploy an application on Heroku, but cannot figure out why it will run locally yet not on Heroku. I was hoping this is something simple I am not seeing, being new to Heroku. Could use any help!

Here is the GitHub Repo: https://github.com/jacklemasters/tech-blog

Here is the Heroku page: https://techblog-lemasters.herokuapp.com/

and here are the errors I am running into: https://www.dropbox.com/scl/fi/gwklh9hj9zbdpq3ql2yob/_Heroku-Logs.paper?dl=0&rlkey=w0v9dmvvj4f26fiecp9hxymmd

CodePudding user response:

Your connection to the database is failing. Can you try double-checking your database connection parameters?

By the way, you've committed a .env file with credentials in it. You should immediately update your database credentials and refrain from committing them in the future.

CodePudding user response:

I think you have some problems with process.env when deploying to Heroku)

Just try to put raw value instead of usage process.env and I guess all be ok. If it's true It means a problem with reading .env

in this field https://github.com/jacklemasters/tech-blog/blob/74176ec84a90ab2dd71b62f7af4e1419350b80db/config/connection.js#L10

I hope it helps! Enjoy programming!

One piece of advice, don't store credentials in public the git repo

  • Related