chore: refactor (#2130)

master
Kevin Wan 2 years ago committed by GitHub
parent 23f34234d0
commit 3bad043413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -79,13 +79,15 @@ func (s *Server) PrintRoutes() {
s.ngin.print() s.ngin.print()
} }
// Routes returns the Http routers which are registered in the engine // Routes returns the HTTP routers that registered in the server.
func (s *Server) Routes() []Route { func (s *Server) Routes() []Route {
routers := make([]Route, len(s.ngin.routes)) var routes []Route
for _, r := range s.ngin.routes { for _, r := range s.ngin.routes {
routers = append(routers, r.routes...) routes = append(routes, r.routes...)
} }
return routers
return routes
} }
// Start starts the Server. // Start starts the Server.

Loading…
Cancel
Save