koa-book
koa-book copied to clipboard
koa的路由问题
根据书中例子 我在demo.js 中写了 app.use(function *(){ this.demo = 'test text'; }); app.use(function *(){ this.body = this.demo; }); 但是 貌似 运行的时候,没有进入第二个 ,页面显示 no found 求大神给看一下原因
app.use(function *(next){
this.demo = 'test text';
yield next;
});
app.use(function *(){
this.body = this.demo;
});
原书代码有问题。