You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
馃搫 The description of the bug or the logic behind your proposal
The reason for this request is that there are plenty of existing middleware code base which provide standard http.Handler and it would be useful to re-use it within bunrouter.
For example, I'm interested to use existing legacy codebase based on gorilla/mux which and its middleware and easily convert it to bunrouter middleware. I managed to figure out mux router part, but I'm struggle to understand how easily re-use existing gorilla/mux middleware functions in bunrouter. Could you please provide a working example which will not require much of the rewrite for existing middleware codebase.
馃殌 The expected result
It would be extremely useful to get documentation how to convert gorilla/mux middleware to bunrouter one, e.g. how to use this code in bunrouter:
func loggingMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Do stuff here
log.Println(r.RequestURI)
// Call the next handler, which can be another middleware in the chain, or the final handler.
next.ServeHTTP(w, r)
})
}
The text was updated successfully, but these errors were encountered:
馃挕 The feature or bug you are proposing
Feature
馃搫 The description of the bug or the logic behind your proposal
The reason for this request is that there are plenty of existing middleware code base which provide standard
http.Handler
and it would be useful to re-use it within bunrouter.For example, I'm interested to use existing legacy codebase based on gorilla/mux which and its middleware and easily convert it to bunrouter middleware. I managed to figure out mux router part, but I'm struggle to understand how easily re-use existing gorilla/mux middleware functions in bunrouter. Could you please provide a working example which will not require much of the rewrite for existing middleware codebase.
馃殌 The expected result
It would be extremely useful to get documentation how to convert gorilla/mux middleware to bunrouter one, e.g. how to use this code in bunrouter:
The text was updated successfully, but these errors were encountered: