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

203
Visualizações
why is localhost:5000 denied in Express.js?

I am following a youtube tutorial:https://www.youtube.com/watch?v=ngc9gnGgUdA&t=1125s. In 18:25. "THIS WORK!" should be printed out on the localhost:5000 page, but I am not able to see it. Anyone can help?

enter image description here

enter image description here

enter image description here

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

From what I can see (as part of the first image is cut off), the problem is probably that you forgot call app.listen, which tells express to listen on port 5000.

app.listen(process.env.PORT, () => {
  // callback when server is up
})
about 4 years ago · Santiago Trujillo Relatório

0

It could be a CORS issue. Please try this

app.use(cors({
    origin: '*',
}));

That is because the same origin will always be allowed. If you need to allow requests from everywhere, that should be manually configurated. The code above basically will set the header Access-Control-Allow-Origin: * to do so.

This article explains in-depth about this. Even if it happens to be not applicable here, it's worth reading.

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