You have to route requests to your mux router. http
package has DefaultServeMux
which is used by AppEngine, but mux
does not. (and it's not registering its routes with net/http
by itself)
That is, all you have to do, is register your mux
router with net/http
:
func main() {
r := mux.NewRouter()
r.HandleFunc("/", HomeHandler)
r.HandleFunc("/products", ProductsHandler)
r.HandleFunc("/articles", ArticlesHandler)
http.Handle("/", r)
}
(straight from the docs)
Important part here is http.Handle("/", r)
.