You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I custom wrap response, the server index routes display incorrect.
My server.js code
varjsonServer=require('json-server')varserver=jsonServer.create()varrouter=jsonServer.router('db.json')varmiddlewares=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: '',})}
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.
The text was updated successfully, but these errors were encountered: