added visualisation

This commit is contained in:
Daniel Ledda
2020-11-04 23:52:27 +01:00
parent 4c106fd763
commit 9c296e0054

View File

@@ -67,12 +67,11 @@ var MainRouter = Router{make(map[string] *PatternRouter)}
func getPatternHandler(pattern string) http.HandlerFunc {
return func (w http.ResponseWriter, r *http.Request) {
cb, err := MainRouter.MethodFuncForPattern(HttpMethod(r.Method), pattern)
context := RequestContext{w, r, HttpMethod(r.Method), pattern}
if err == nil {
err = cb(w, r)
}
if err != nil {
sendInternalError(err, context)
sendInternalError(err, w, r)
}
}
}