Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
express cannot GET error using with react

I manage to setup react, basically express just as the api server. I can navigate around my react app using react-router, it's a single page application.

But when I refresh for example http://localhost/login I got error of cannot GET /login I know the issue, but I don't know how to fix it.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You haven't posted your code, but I guess that you don't return the React app at the * route, which means that if you start at /, you'll be fine because it's handled, but if you want to get any other endpoint not via the app itself, but directly via an address, Express will look for a /login (for example) route handler and hence it's not there, it'll return 404.

TLDR: send the React SPA as the response on * GET and React Router will handle the rest.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda