17 lines
344 B
Go
17 lines
344 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
// ExampleMiddleware is a test middleware.
|
||
|
func ExampleMiddleware(next http.Handler) http.Handler {
|
||
|
middleware := func(w http.ResponseWriter, r *http.Request) {
|
||
|
log.Printf("ExampleMiddleware called on route %s", r.URL.Path)
|
||
|
next.ServeHTTP(w, r)
|
||
|
}
|
||
|
|
||
|
return http.HandlerFunc(middleware)
|
||
|
}
|