If I had this to show an index for a users model:
app.use(route.get('/user', list));
function *list() {
var res = yield users.find({});
this.body = res;
};
Is it possible to put the database access part into its own middleware and then call next?
How could you pass the resulting list of users down to the next middleware? And somehow pass next through the route?
So the first middleware is any DB access needed, and the second middleware is presentation?