MCPcopy
hub / github.com/gofiber/fiber / Add

Method Add

group.go:173–181  ·  view source on GitHub ↗

Add allows you to specify multiple HTTP methods to register a route. The provided handlers are executed in order, starting with `handler` and then the variadic `handlers`.

(methods []string, path string, handler any, handlers ...any)

Source from the content-addressed store, hash-verified

171// Add allows you to specify multiple HTTP methods to register a route.
172// The provided handlers are executed in order, starting with `handler` and then the variadic `handlers`.
173func (grp *Group) Add(methods []string, path string, handler any, handlers ...any) Router {
174 converted := collectHandlers("group", append([]any{handler}, handlers...)...)
175 grp.app.register(methods, getGroupPath(grp.Prefix, path), grp, converted...)
176 if !grp.hasAnyRoute {
177 grp.hasAnyRoute = true
178 }
179
180 return grp
181}
182
183// All will register the handler on all HTTP methods
184func (grp *Group) All(path string, handler any, handlers ...any) Router {

Callers 11

GetMethod · 0.95
HeadMethod · 0.95
PostMethod · 0.95
PutMethod · 0.95
DeleteMethod · 0.95
ConnectMethod · 0.95
OptionsMethod · 0.95
TraceMethod · 0.95
PatchMethod · 0.95
QueryMethod · 0.95
AllMethod · 0.95

Calls 3

collectHandlersFunction · 0.85
getGroupPathFunction · 0.85
registerMethod · 0.80

Tested by

no test coverage detected