MCPcopy Index your code
hub / github.com/labstack/echo / AddRoute

Method AddRoute

group.go:172–178  ·  view source on GitHub ↗

AddRoute registers a new Routable with Router

(route Route)

Source from the content-addressed store, hash-verified

170
171// AddRoute registers a new Routable with Router
172func (g *Group) AddRoute(route Route) (RouteInfo, error) {
173 // Combine middleware into a new slice to avoid accidentally passing the same slice for
174 // multiple routes, which would lead to later add() calls overwriting the
175 // middleware from earlier calls.
176 groupRoute := route.WithPrefix(g.prefix, append([]MiddlewareFunc{}, g.middleware...))
177 return g.echo.add(groupRoute)
178}

Callers 2

MatchMethod · 0.95
AddMethod · 0.95

Calls 2

WithPrefixMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected