jsonserver not redirecting using rewriter
问题 I have an employees endpoint with some data in my db.json . I'm using node v6.14.9. My server.js looks like this: // server.js const jsonServer = require('json-server') const server = jsonServer.create() const router = jsonServer.router('db.json') const middlewares = jsonServer.defaults() server.use(middlewares) server.use(jsonServer.rewriter({ '/api/*': '/$1' })) server.use(router) server.listen(3000, () => { console.log('JSON Server is running') }) Server starts on port 3000. If I open ht