app.use(async ctx => {
ctx.body = 'Hello World';
// running code here after response
});
how should i do ?
app.use(async ctx => {
ctx.body = 'Hello World';
// running code here after response
// don't use `await` here
someBizLogic(ctx).catch(err => {
// handle error
});
});
async function someBizLogic(ctx) {
// your async biz logic
}
Most helpful comment