Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene committed Mar 1, 2024
1 parent b084df1 commit e60088f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ mux := http.NewServeMux()
group := routegroup.New(mux)
group.Route(func(b *routegroup.Bundle) {
b.Use(loggingMiddleware, corsMiddleware)
b.HandleFunc("GET /hello", helloHandler)
b.HandleFunc("GET /bye", byeHandler)
b.Handle("GET /hello", helloHandler)
b.Handle("GET /bye", byeHandler)
})
http.ListenAndServe(":8080", mux)
```
Expand All @@ -122,16 +122,16 @@ mux.Use(loggingMiddleware, corsMiddleware)
// this group will inherit the middlewares from the base group
apiGroup := mux.Group()
apiGroup.Use(apiMiddleware)
apiGroup.HandleFunc("GET /hello", helloHandler)
apiGroup.HandleFunc("GET /bye", byeHandler)
apiGroup.Handle("GET /hello", helloHandler)
apiGroup.Handle("GET /bye", byeHandler)


// mount another group for the /admin path with its own set of middlewares,
// using `Set` method to show the alternative usage.
// this group will inherit the middlewares from the base group as well
mux.Mount("/admin").Route(func(b *routegroup.Bundle) {
b.Use(adminMiddleware)
b.HandleFunc("POST /do", doHandler)
b.Handle("POST /do", doHandler)
})

// start the server, passing the wrapped mux as the handler
Expand Down Expand Up @@ -197,8 +197,6 @@ func (s *Service) fileServerHandlerFunc() http.HandlerFunc {
webFS.ServeHTTP(w, r)
}
}


```

## Contributing
Expand Down

0 comments on commit e60088f

Please sign in to comment.