I tried following the mongodb and heroku guide but I’m still lost. I’m using a local database for the backend projects and I got everything running smoothly locally. However when I deploy to heroku, one of the first errors I see reads " MongoError: failed to connect to server [localhost:27017] on first connect". I’m using mongoose to connect to the localhost. I already have mongo running and listening for any connections in the background. I’m not quite sure what I’m doing wrong. Thanks in advance.
You can’t use local databases for a deployed app, you have to use a remote database.
I use https://mlab.com/ which is free if you use their ‘sandbox’ databases.
See this wiki article for details:
Thanks for the response! I had a hunch I wouldn’t be able to use a local database.