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 support #27

Open
dennypenta opened this issue Feb 25, 2019 · 3 comments
Open

Middleware support #27

dennypenta opened this issue Feb 25, 2019 · 3 comments

Comments

@dennypenta
Copy link

Does the project have the support of middlewares?
So if not - I can implement it.
Now I can just wrap around ServeHTTP function, but sometimes I wanna choose a group to wrap it.

@powerman
Copy link
Owner

You can add your middlewares by wrapping jsonrpc2.HTTPHandler, like this:

http.Handle("/rpc", yourMiddleware1(yourMiddleware2(jsonrpc2.HTTPHandler(nil))))

Can you please explain what else do you need?

@dennypenta
Copy link
Author

For example, I have 10 handlers and I need to wrap only 5. This way won't work.

@powerman
Copy link
Owner

powerman commented Feb 25, 2019

I don't understand what you mean and how it may not work. You may explain in Russian if you like to.

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