initial commit

This commit is contained in:
2024-05-04 08:28:22 -05:00
commit e2b82ba683
5 changed files with 190 additions and 0 deletions

16
main.go Normal file
View File

@@ -0,0 +1,16 @@
package middleware
import "net/http"
type Middleware func(http.Handler) http.Handler
func CreateStack(xs ...Middleware) Middleware {
return func(next http.Handler) http.Handler {
for i := len(xs) - 1; i >= 0; i-- {
x := xs[i]
next = x(next)
}
return next
}
}