diff --git a/documentation/docs/guides/middlewares.md b/documentation/docs/guides/middlewares.md index 02dc4f2e..ae06d8db 100644 --- a/documentation/docs/guides/middlewares.md +++ b/documentation/docs/guides/middlewares.md @@ -22,7 +22,7 @@ func main() { s := fuego.NewServer() // Add a middleware to the whole server - fuego.Use(func(s, next http.Handler) http.Handler { + fuego.Use(s, func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Do something before the request next.ServeHTTP(w, r) @@ -30,6 +30,8 @@ func main() { }) }) + fuego.Use(s, myMiddleware) + fuego.Get(s, "/", myController) s.Run()