Slide 50
Slide 50 text
Express Error Middleware
app.post('/login', function (req, res, next) {
db.query('SELECT ...', function (err, user) {
if (err) return next(err);
});
});
app.use(function (req, res, next, err) {
// spit out your own error page, log the error, etc
next();
});