covalent-highlight-nightly icon indicating copy to clipboard operation
covalent-highlight-nightly copied to clipboard

Custom routes

Open aciccarello opened this issue 7 years ago • 0 comments

Feature Request

There should be a way to configure custom route mapping. These would translate an incoming URL to one that matches the covalent-data structure

Code snippets if applicable

Possible configuration

/api/*: /$1
/user: /users/1
"/records/:id/header": "/headers/:id"

What is the expected behavior?

Should be able to define configurations to

  • Map all requests of a path to the base path
  • Map an endpoint to a specific record
  • Map requests with an id (or multiple path variables) to a request using that or those variables

What is the motivation / use case for changing the behavior?

Not all apis will conform to the structure encouraged by covalent-data. This would provide an easy way to implement more difficult api structures without creating convoluted schema structures.

Other information

(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix) See the (json-server configuration](https://github.com/typicode/json-server#add-custom-routes) for an existing implementation.

aciccarello avatar Dec 14 '17 17:12 aciccarello