Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!