Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

koa的路由问题 #3

Open
maomaoking opened this issue Jan 14, 2016 · 1 comment
Open

koa的路由问题 #3

maomaoking opened this issue Jan 14, 2016 · 1 comment

Comments

@maomaoking
Copy link

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

@hacke2
Copy link

hacke2 commented Jan 15, 2016

app.use(function *(next){
  this.demo = 'test text';
  yield next;
});
app.use(function *(){
  this.body = this.demo;
});

原书代码有问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants