added visualisation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user