When I custom wrap response, the server index routes display incorrect.
My server.js code
var jsonServer = require('json-server')
var server = jsonServer.create()
var router = jsonServer.router('db.json')
var middlewares = jsonServer.defaults()
server.use(middlewares)
server.use(router)
server.listen(3000, function () {
console.log('JSON Server is running')
})
router.render = function (req, res) {
res.jsonp({
body: res.locals.data,
code: 0,
msg: '',
})
}
The response is correct.

But when I open http://127.0.0.1:3000 the page display:

My env is:
(Tao) ➜ api git:(master) ✗ json-server --version
0.8.17
(Tao) ➜ api git:(master) ✗ node --version
v6.2.1
Thanks for your json-server.
When I custom wrap response, the server index routes display incorrect.
My server.js code
The response is correct.

But when I open http://127.0.0.1:3000 the page display:

My env is:
Thanks for your json-server.