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

116
Vistas
json-server create deep routes in javascript with params

Im trying to recreate an exisiting api in json server to be able to use mock data locally. Now Im stuck, because I can't find a way to create deeper routes.

I need two routes:

/api/v1/definintion/:table and /api/v1/:table/list

My routes.json:

{
    "/api/v1/*": "/$1",
    "/:table/list": "/:table",
   " /definition/:table": "/:table/definition"
}

I'm using javascript for this. How can I define the /:table/definition route inside my index.js? And how can I define diffrent outputs for the :table param?

An example call could be /api/v1/definintion/employees.

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