• Empleos
  • Sobre nosotros
  • Empleos
    • Inicio
    • Empleos
    • Cursos y retos
  • Empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

124
Vistas
Express regex include characters after slash

I have the below logic in my code -

/myApp/:id - route to router A
/myApp - route to router B

I have the following regex in my code

/myApp/logs/:id(*)

Clearly if my URL ends with a /, it will end up going to router A, and return a 404 while ideally I want it to be routed to router B since it's valid to have a trailing slash. In other words, how do I write my regex so it ignores if it's a forward slash alone, and routes only if it matches everything after that in the id component.

over 3 years ago · Santiago Gelvez
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda