How do you connect mlab to mern-starter?

Responses (1)

Join the discussion

hi! did you resolve this? i can help. basically you set the MONGO_URL environment variable to the url you have been provided by mlab (eg: mongodb://<dbuser>:<dbpassword>@ds131041.mlab.com:31041/heroku_t7pj6x5j). in heroku this would be set by heroku config:set MONGO_URL=etcetcetc.

within the code, search "process.env.MONGO_URL" to see how it is used.

Write a reply...

loading ...