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

164
Visualizações
`window.location.href` in client vs `res.redirect` in express

I want to send user to a certain link, there are 2 ways to getting there:

  1. Browser Client Approach
  • I call express endpoint /redirect
  • It calculates the url to redirect to
  • It returns the url to redirect to
  • Client browser redirects via window.location.href
  1. Express Server Approach
  • I call express endpoint /redirect
  • It calculates the url to redirect to
  • It calls res.redirect(url)

Which is the best way? Is there any significant differences between these?

The current use case I'm looking into has documentation which showed the 2. express example. However I saw some use cases where the 1. browser approach is used

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