Skip to content

Commit

Permalink
chore: refactor (#2130)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Jul 11, 2022
1 parent 23f3423 commit 3bad043
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rest/server.go
Expand Up @@ -79,13 +79,15 @@ func (s *Server) PrintRoutes() {
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 {
routers := make([]Route, len(s.ngin.routes))
var routes []Route

for _, r := range s.ngin.routes {
routers = append(routers, r.routes...)
routes = append(routes, r.routes...)
}
return routers

return routes
}

// Start starts the Server.
Expand Down

0 comments on commit 3bad043

Please sign in to comment.