-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