-
Notifications
You must be signed in to change notification settings - Fork 577
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
could i get a router param in middleware #74
Comments
At that point, the router has not even matched the route. You will have to have the middleware execute after the route has been matched but before your handler executes |
Closing, Hope this answered your question |
How do you do that? |
@fiatjaf something like this: // my app url
router1 := mux.NewRouter()
router1.HandleFunc("/hrm/{dbId}/users", negroni.New(
middleware2,
negroni.Wrap(router1),
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
i want to check some auth in middleware, should check url param is valid. but i use mux.Vars["dbId"], it return empty. like below code,
how can i get router param in middleware?
thanks.
The text was updated successfully, but these errors were encountered: