nodejs express錯誤處理中間件

app.get('/a',function(req,res,next){ res.end('hahah'); next(new Error('錯誤啦')); }); app.use('/a',function(err,req,res,next){ console.log('路由錯誤'+err); }) //all error中間件 app.use(function(err, req,
相關文章
相關標籤/搜索