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

Middleware after route #21

Open
renataogarcia opened this issue Mar 3, 2022 · 3 comments
Open

Middleware after route #21

renataogarcia opened this issue Mar 3, 2022 · 3 comments

Comments

@renataogarcia
Copy link

I'm trying to migrate a code that is working with @koa/router, but the last middlware doesn't get called when using koa-tree-router:

router.use(...) <= this works
router.get(...)
router.use(...) <= this is never called

Is that a known limitation?

@steambap
Copy link
Owner

steambap commented Mar 3, 2022

This was added in #20 and I never thought it will be called after another get call. Also that PR did not include a TS definition. I will try to fix it during the weekend.

@steambap
Copy link
Owner

steambap commented Mar 6, 2022

Yes, once you register a route, use will not append to existing route, that is the limitation.

@renataogarcia
Copy link
Author

I see, thanks for the prompt response! I managed to work it around for now, but it might be useful to have this behaviour supported - if it's not too dificult to implement, since koa-router supports it, would make it easier to switch.

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