Last active
August 29, 2015 14:10
-
-
Save mctep/28f39f0d239fca657287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/', function(req, res, next) { | |
if (typeof req.body.foo !== 'boolean') { | |
return next (new TypeError()); | |
} | |
next() | |
}, function(req, res, next) { | |
mysql.query('select 1', function(err, result) { | |
if (err) { return next(err); } | |
res.send(result); | |
}) | |
}); | |
router.get('/') | |
.body({ foo: Boolean }) | |
.use(function() { | |
return this.source('mysql').query('select 1'); | |
}) | |
.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment