I’m doing a capstone I have to deliver, I did an app node.js + angular + mongodb that I’m deploy on heroku.
The problem is that the db data I put in mLab can not be seen.
After creating on mLab the DB and User, on heroku I created the environment variable:
MONGODB_URI mongodb: // <dbuser @ ds125774.mlab.com: 25774 / dbname
in db.js file I wrote:
var dburl = process.env.MONGODB_URI || ‘Mongodb: // localhost: 27017 / hotel’;
In the terminal I wrote: heroku config: set MONGODB_URI = mongodb: // <dbuser @ ds125774.mlab.com: 25774 / dbname
what is missing?
Hmm. I haven’t deployed an app to heroku before, but I’ve had problems with the mlab url they give you. When I removed the ‘alligator’ <> characters from it, everything worked (on a local machine).
If you have access to the terminal, you can use a command to test if port 27017 is being used (presumably by mongodb). What that command is, I’m not sure. It depends on the system.
You can also double-check that everything is spelled right.
That’s all I can offer you with what I know. I hope you get it figured out!
Thanks for the answer, now it’s all working, I made a mistake in creating the db collection.