Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!