Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
Why is my nodejs express server connecting to the MongoDB on my local machine and the AWS EC2 Instance

I have a MongoDB running on my local machine and another MongoDB running on the AWS EC2 instance where my express server and my angularjs web app is installed. That is:

On my local machine (Windows environment), running:

  • MongoDB
  • Nodejs Express server

On AWS EC2 instance (ubuntu), running:

  • MongoDB
  • Nodejs Express server
  • AngularJS web app

When I browse my web side running on AWS EC2 instance (using https://ec2_public_ip:3443/home/app/index.html), it retrieves data from the MongoDB running on my local machine. If I shut down the MongoDB and Express server on my local machine, I get Failed to connect to resource error. Why is my express server not connecting to the MongoDB running on AWS?

This is my connection string in the app.js file:

'mongoUrl' : 'mongodb://localhost:27017/myMongodatabase',

I also tried

'mongoUrl' : 'mongodb://0.0.0.0:27017/myMongodatabase',

Both did not work on my AWS instance.

I'm learning to use MongoDB, AWS, Express and now I am confused. Any help is appreciated.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda