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

Investigate confusing router API #445

Open
Joannis opened this issue May 9, 2024 · 1 comment
Open

Investigate confusing router API #445

Joannis opened this issue May 9, 2024 · 1 comment
Assignees

Comments

@Joannis
Copy link
Contributor

Joannis commented May 9, 2024

Adding a middleware to the router only affects routes defined after the middleware was added. I believe this to be confusing behaviour, and believe we should investigate the API design here.

@adam-fowler
Copy link
Member

This happens because the current middleware chain is applied at the point the route is added. I actually think this correct. It also provides flexibility in that someone can add middleware, some routes and then add some more middleware that won't be applied to the existing routes. Anyway if we were to stick with this it have to be documented for sure.

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