多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` const Koa = require('koa') const app = new Koa() app.use(async (ctx, next) => { console.log(1) ctx.body = 'hello koa' await next() console.log(2) }) app.use(async (ctx, next) => { console.log(3) await next() console.log(4) }) app.use(async (ctx, next) => { console.log(5) }) app.listen(3031, () => { console.log('http://localhost:3031/'); }) ``` 输入结果:13542, 洋葱模型:一层一层进入,一层一层出