gogorilla

Go Gorilla Mux "match anything" path template


What is the proper syntax to create a simple "match anything" handler?

mux.NewRouter().StrictSlash(true).Path("/")....

The above code seems to strictly match / and /foo won't get matched


Solution

  • This should work:

    route := mux.NewRouter().PathPrefix("/")