Last active
July 5, 2018 21:50
-
-
Save papisz/118d1a2f713d1b46ad1a02c30c96abfe to your computer and use it in GitHub Desktop.
chi-urlparam-good-middleware
This file contains 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
r := chi.NewRouter() | |
r.Route("/pets", func(r chi.Router) { | |
r.With(petMiddleware).Route("/{pet}", func(r chi.Router) { | |
r.Get("/", getPetHandler) | |
r.Put("/", putPetHandler) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment