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

Support apply middlewares for route #27

Open
marswong opened this issue Sep 17, 2020 · 2 comments
Open

Support apply middlewares for route #27

marswong opened this issue Sep 17, 2020 · 2 comments

Comments

@marswong
Copy link

currently we could only apply global middlewares, in complicated applications, we might need to apply middlewares for different business, assume there are routes (/foo and '/bar') and middlewares (foo and bar), the usage could be:

app.Use('/foo', foo)
app.Use('/bar', bar)
@aisk
Copy link
Owner

aisk commented Sep 17, 2020

I think middleware for sub router is a better choice? #14

@marswong
Copy link
Author

I think middleware for sub router is a better choice? #14

yup, sub router is a good choice for simple router, but what if we need different pre-process logic for the same-level sub router?

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

No branches or pull requests

2 participants