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

104
Vistas
Where are relative route paths made accessible on an express api?

When using express, I often make the mistake of registering route handlers with relative paths:

const tagRoutes = require('./app/routes/tag.js');
app.use("api/tag", tagRoutes); // Should be "/api/tag"

Those routes are then inaccessible at /api/tag. But then where are they accessible?

The express path examples docs don't show an example for relative paths; they all begin with a /. This makes me wonder why not just preface every route with / if it isn't already.

When I turn on debugging for express, I see this:

...
express:router use 'api/tag' router +0ms
express:router:layer new 'api/tag' +0ms
...
about 4 years ago · Juan Pablo Isaza
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