Skip to content

Instantly share code, notes, and snippets.

@papisz
Last active July 5, 2018 21:03
Show Gist options
  • Save papisz/001cfd6b95ca77bfd5a054e176f298fe to your computer and use it in GitHub Desktop.
Save papisz/001cfd6b95ca77bfd5a054e176f298fe to your computer and use it in GitHub Desktop.
// BAD EXAMPLE, doesn't work!
r := chi.NewRouter()
r.With(petMiddleware).Route("/pets", func(r chi.Router) {
r.Route("/{pet}", func(r chi.Router) {
r.Get("/", getPetHandler)
r.Put("/", putPetHandler)
})
})
http.ListenAndServe(":8000", r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment