M
M
Max Zhukov2018-08-15 16:11:37
MongoDB
Max Zhukov, 2018-08-15 16:11:37

Why not connecting to remote mongo on heroku server?

mistake:

MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]

on the local everything is fine, I connect to the remote mlab database, on heroku an error is displayed.
*PS. I entered the path to the remote database with my hands, but still it refers to localhost, I watched on the heroku server that the path was the one that I specified.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-08-15
@VladimirAndreev

replace localhost with the ip of the remote server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question