1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

0

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

settings

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250