-1
我正在使用Expressjs和Mongoosejs。我的路线是这个样子:router.use中的异步操作
router.use('/', function(req, res, next) {
//check for matching API KEY in database for all routes that follow
//Asynchronous Mongoosejs find.one
}
router.get('/status/:key/:token', function (req, res) {
//more code here that needs to wait before being executed
}
只是想知道如果执行router.get
代码之前在router.use
异步功能将解决?
干杯此! – tommyd456 2014-11-21 22:26:34