you know how to use Express middleware
app.get(‘/‘, function(req, res) {
var someVar1;
promisesomeshit()
.then(function(someshit){
someVar1 = someshit;
return promiseSomeOtherShit();
})
.then(function(otherShit){
res.status(200).send(otherShit + someVar1)
});
});
well in Koa you write that shit out:
app.get(‘/‘, function* () {
let someshit = yield promisesomeshit();
let someMoreShit = yield promiseSomeOtherShit();
this.body = someshit + someMoreShit;
});