stretchr / goweb

A lightweight RESTful web framework for Go
632 stars 61 forks source link

Support fallback to default http.ServeMux #1

Closed alecthomas closed 11 years ago

alecthomas commented 11 years ago

Necessary to support packages like expvar.

alecthomas commented 11 years ago

Also necessary for net/http/pprof`, and so on.

I'd suggest having http.DefaultServeMux as enabled by default, but that's a bit more of a significant change to the default behaviour of goweb. Your call.

alecthomas commented 11 years ago

I subsequently realised that I could simply do:

goweb.MapFunc("*", func(c *goweb.Context) {
    http.DefaultServeMux.ServeHTTP(c.ResponseWriter, c.Request)
})

So ... just imagine this whole pull request didn't exist!