Hello, I am very new to Node.js and I want to make Mern-Starter app use mlab mongodb instad of the local mongodb. What config file should I edit?
Write your answer…
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.