This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| router := httprouter.New() | |
| r := Middlewares{router: router} | |
| r.Use(func(next http.Handler) http.Handler { | |
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| fmt.Println("First Middleware") | |
| next.ServeHTTP(w, r) | |
| }) | |
| }) |
OlderNewer