code: func (s *Server) createMux() *mux.Router {
  	m := mux.NewRouter()
  
  	logrus.Debug("Registering routers")
  	for _, apiRouter := range s.routers {
  		for _, r := range apiRouter.Routes() {
  			f := s.makeHTTPHandler(r.Handler())
  
  			logrus.Debugf("Registering %s, %s", r.Method(), r.Path())
  			m.Path(versionMatcher + r.Path()).Methods(r.Method()).Handler(f)
  			m.Path(r.Path()).Methods(r.Method()).Handler(f)
  		}
  	}
  
  	debugRouter := debug.NewRouter()
  	s.routers = append(s.routers, debugRouter)
  	for _, r := range debugRouter.Routes() {
  		f := s.makeHTTPHandler(r.Handler())
  		m.Path("/debug" + r.Path()).Handler(f)
  	}
  
  	notFoundHandler := httputils.MakeErrorHandler(pageNotFoundError{})
  	m.HandleFunc(versionMatcher+"/{path:.*}", notFoundHandler)
  	m.NotFoundHandler = notFoundHandler
  	m.MethodNotAllowedHandler = notFoundHandler
  
  	return m
  }
docs: // createMux initializes the main router the server uses.