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

186
Vistas
NodeJS Express recursive routes

Some website's APIs let you do something like this:

            Initial user's id          their first friend, also a user
                 v                     v
GET /api/users/54282/friends/0/friends/0
                             ^
                        first item in array, would also be a user

Rather than

            Initial user's id
                 v
GET /api/users/54282/friends
Look at friends[0].id to get the first friend's id

            First friend's id
                 v
GET /api/users/97420/friends
Look at friends[0].id to get the first friend's id

            First friend's id
                 v
GET /api/users/31230

Another example although i'm not sure if Github allows this

Get the 10th collaborator's repos
GET /api/users/sharedrory/repos/312388/collaborators/10/repos

How do would you implement something like this in express?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It seems the term I wanted was "nested"/"nesting"

Rest with Express.js nested router https://gist.github.com/zcaceres/f38b208a492e4dcd45f487638eff716c

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