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

382
Views
json-server "Access to localhost was denied" in Chrome

I just started using json-server and created a script, 'npm run server' to build it. However, when I try to access the JSON in my browser, I get "Access to localhost was denied".

Here's the script:

json-server --watch db.json --port 5000

enter image description here

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

I had the same issue with port 5000. I think it might be due to the port already being used by something else (if you're on a Mac, I believe it started with Monterey). I changed it to another port and it worked.

about 4 years ago · Juan Pablo Isaza Report

0

Same, I just changed the port flag in the json script to 3000, re-ran the server and all good.

 "scripts": {
    "server": "json-server --watch db.json --port 3000"
  }
about 4 years ago · Juan Pablo Isaza Report

0

It's due to the AirPlay receiver in Mac OS Monterey using port 5000. More details at this answer.

You can either disable AirPlay (System preferences --> Sharing), or start the server on another port in your package.json as mentioned:

--port 3000

about 4 years ago · Juan Pablo Isaza 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!