I created a shopping site using node.js
and launched it on Heroku, but I face one problem:
My heroku is not connecting with mongoose atlas
However, all configuration seems right, like uri variable.
What should I do: I did not get any error.
I created a shopping site using node.js
and launched it on Heroku, but I face one problem:
My heroku is not connecting with mongoose atlas
However, all configuration seems right, like uri variable.
What should I do: I did not get any error.
The official documentation is art "Using MongoDB Atlas on Heroku", written by Adrienne Tacke, so double-check your config (as in here), especially the db connection.
And, as described here, in order to do this in combination with Heroku dynos, add 0.0.0.0/0
(i.e. all addresses) to your MongoDB Atlas whitelist.
Finally, check your code (as seen here), using MongoClient
.
You have a concrete example at "M2 - Heroku Deployment (with Mongo Atlas)" from Uros Cirkovic:
check your logs with heroku logs -n 200