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

183
Vistas
Why am I getting these errors in my console on this nodejs weather app?

This is the link to the github repo for my code.

https://github.com/Messan93/Messan93-WeatherJournal.io

Console error screenshot

Everything seem to be fine but these are the errors am still getting. I can see what the error message is but I don't see anything wrong with the code on that line.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You're using relative URLs on those API calls you're making, and since you're opening your index.html directly from your file system rather than serving it through a server, the paths are relative to your file system.

The simplest fix (just to get your example working) would be to provide absolute URLs instead:

Change postData('/add' to postData('http://localhost:3000/add' and await fetch('/all') to await fetch('http://localhost:3000/all')

A more real-world fix would be to serve the index.html file from your express server.

about 4 years ago · Santiago Trujillo Denunciar
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