Files
rest-server/vendor/goji.io/dispatch.go
Alexander Neumann 6054876201 Vendor dependencies
2016-12-30 18:34:37 +01:00

20 lines
294 B
Go

package goji
import (
"net/http"
"goji.io/internal"
)
type dispatch struct{}
func (d dispatch) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h := ctx.Value(internal.Handler)
if h == nil {
http.NotFound(w, r)
} else {
h.(http.Handler).ServeHTTP(w, r)
}
}