Example #1
0
func Enable(monitorPath string, rt zerver.Router) (err error) {
	if monitorPath != "" {
		path = monitorPath
	}
	if !initRoutes() {
		return
	}

	for subpath, handler := range routes {
		if err = rt.Handler(path+subpath, handler); err != nil {
			return
		}
		options = append(options, "GET "+path+subpath+": "+infos[subpath]+"\n")
	}
	err = rt.Filter(path, zerver.FilterFunc(globalFilter))
	return
}