feat(account): #49 account page
This commit was merged in pull request #59.
This commit is contained in:
@@ -2,10 +2,11 @@ package middleware
|
||||
|
||||
import "net/http"
|
||||
|
||||
// Chain list of handlers together
|
||||
func Wrapper(next http.Handler, handlers ...func(http.Handler) http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
lastHandler := next
|
||||
for i := len(handlers) - 1; i >= 0; i-- {
|
||||
for i := 0; i < len(handlers); i++ {
|
||||
lastHandler = handlers[i](lastHandler)
|
||||
}
|
||||
lastHandler.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user