Closed
Description
I'm trying to figure out how to implement custom routes using json-server's rewriter.
I have tried this:
server.use(jsonServer.rewriter({
'/blog/:resource/:id/show': '/:resource/:id',
'/articles?id=:id': '/posts/:id'
}))
let core: CoreApp | undefined;
But I get 404 Not Found
from http://localhost:3000/dev/api/blog/posts/1/show (I'm using the example JSON from the json-server readme) http://localhost:3000/dev/api/posts/1 works just fine.
What am I doing wrong?
On a related note, it would be nice if the api/
path could be configured from appconfig.json. I may put in a PR for that change.