简体   繁体   中英

How Do I Async Parallel Multiple app.use Calls?

How do I async parallel multiple app.use calls? I've read https://github.com/caolan/async and I've seen:

async.parallel([
    function(){ ... },
    function(){ ... }
], callback);

But I'm not quite sure how to use it with the following:

app.use('/api/users', api.users);
app.use('/api/score', api.score);
app.use('/api/payment', api.payment);
app.use('/api/ci',api.ci);
app.use('/api/db', api.concepts);
app.use('/api/swing', api.swing);
app.use('/api/list', api.list);

app.use('/api/users', api.users) is not an asynchronous code. It just assign api.users to handle request with paths matching /api/users . You don't need to use async.parallel for this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM