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

app中使用koa-router方法无效? #57

Open
AbeDai opened this issue Feb 2, 2019 · 1 comment
Open

app中使用koa-router方法无效? #57

AbeDai opened this issue Feb 2, 2019 · 1 comment

Comments

@AbeDai
Copy link

AbeDai commented Feb 2, 2019

version: 1.1.16

通过koa2 project_name创建项目后,在app.js中,出现了app.use(router.routes(), router.allowedMethods());

app.use()不是只接受第一个参数的吗?

@wangminghuan
Copy link

同问,查阅源码也发现use只支持一个参数,不知道此处是依据哪个版本的api。我改成了这样:app.use(router.routes()).use(router.allowedMethods())

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