summaryrefslogtreecommitdiff
path: root/middleware.go
blob: 2b561052b9824ded8ed4fef998be63506518591d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
package mux

import "net/http"

type Middleware func(http.Handler) http.Handler

func Use(handler http.Handler, middlewares ...Middleware) http.Handler {
	for _, h := range middlewares {
		handler = h(handler)
	}

	return handler
}