Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

381
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda