12if (!test) app.use(logger('dev'));
13
14▶// error handling middleware have an arity of 4
15// instead of the typical (req, res, next),
16// otherwise they behave exactly like regular
· · ·
18// in different orders etc.
19
20▶function error(err, req, res, next) {
21 // log it
22 if (!test) console.error(err.stack);
· · ·
22▶ if (!test) console.error(err.stack);
23
24 // respond with 500 "Internal Server Error".
· · ·
24▶ // respond with 500 "Internal Server Error".
25 res.status(500);
26 res.send('Internal Server Error');
· · ·
26▶ res.send('Internal Server Error');
27}
28
+ 6 more matches in this file