Skip to content

Commit

Permalink
Hint that httprouter.Router implements http.Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mozey committed Dec 11, 2018
1 parent e7f2cfc commit c9c98c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ func main() {
router.HandlerFunc("GET", "/hello/:name", Hello)

// Middleware
handler := cors.Default().Handler(router) // WARNING Allows all origins
var handler http.Handler = router
handler = cors.Default().Handler(router) // WARNING Allows all origins
handler = LoggingMiddleware(handler)
handler = AuthMiddleware(handler)
handler = handlers.CompressHandlerLevel(handler, gzip.BestSpeed)
Expand Down

0 comments on commit c9c98c5

Please sign in to comment.