// createMux initializes the main router the server uses.
createMux initializes the main router the server uses.
// createMux initializes the main router the server uses .
func (s *Server) createMux() *mux.Router {
	m := mux.NewRouter()
	logrus.Debug("Registering routers")
	for _, apiRouter := range s.routers {
		for _, r := range apiRouter.Routes() {
			handler := s.makeHTTPHandler(r.Handler())
			m.Path(r.Path()).Methods(r.Method()).Handler(handler)
			logrus.Debugf("Registering %s, %s", r.Method(), r.Path())
		}
	}
	debugRouter := debug.NewRouter()
	s.routers = append(s.routers, debugRouter)
	for _, r := range debugRouter.Routes() {
		handler := s.makeHTTPHandler(r.Handler())
		m.Path("/debug" + r.Path()).Handler(handler)
	}
	return m
}
func ( s * Server ) createMux ( ) * mux . Router { m := mux . NewRouter ( ) logrus . Debug ( " " ) for _ , apiRouter := range s . routers { for _ , r := range apiRouter . Routes ( ) { handler := s . makeHTTPHandler ( r . Handler ( ) ) m . Path ( r . Path ( ) ) . Methods ( r . Method ( ) ) . Handler ( handler ) logrus . Debugf ( " " , r . Method ( ) , r . Path ( ) ) } } debugRouter := debug . NewRouter ( ) s . routers = append ( s . routers , debugRouter ) for _ , r := range debugRouter . Routes ( ) { handler := s . makeHTTPHandler ( r . Handler ( ) ) m . Path ( " " + r . Path ( ) ) . Handler ( handler ) } return m }
createMux initializes the main router the server uses.
createMux initializes the main router the server uses .