How can I apply middleware to a Go Gorilla Toolkit mux subrouter?
I have the following code:
router := mux.NewRouter().StrictSlash(true)
apiRouter := router.PathPrefix("/api/").Subrouter()
apiRouter.Methods(http.MethodGet).
Path("/api/path/to/handler").Handler(handleAPICall)
I want to apply a middleware handler that checks a security token, but only on those paths that start with /api
.