In the previous recipe, we served static resources through Go's HTTP file server. In this recipe, we will look at how we can serve it through the Gorilla Mux router, which is also one of the most common ways of creating an HTTP router.
Serving static files over HTTP using Gorilla Mux
Getting ready...
As we have already created a template which serves main.css from the static/css directory present on the filesystem in our previous recipe, we will just update it to use the Gorilla Mux router.
How to do it...
- Install the github.com/gorilla/mux package using the go get...