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

router 注册顺序的问题 #11

Open
doxiaodong opened this issue Jul 16, 2019 · 2 comments
Open

router 注册顺序的问题 #11

doxiaodong opened this issue Jul 16, 2019 · 2 comments

Comments

@doxiaodong
Copy link

有相关文档详细讲解 router 注册顺序问题么?
比如不同 controller 内部的 route ,以及同一个 controller 不同方法上的 route 和 同一个方法上的 多个 route

@zhang740
Copy link
Owner

  • controller 间根据文件加载顺序(一般系统是字母序)
  • controller 内多个 route 会做简单排序,将同级参数、通配符后置

https://github.com/zhang740/egg-controller/blob/HEAD/lib/register.ts#L12-L35

@doxiaodong
Copy link
Author

同一个 controller 不同方法上的 route 这个呢

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