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

Method Add

app.go:1095–1100  ·  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

1093// Add allows you to specify multiple HTTP methods to register a route.
1094// The provided handlers are executed in order, starting with `handler` and then the variadic `handlers`.
1095func (app *App) Add(methods []string, path string, handler any, handlers ...any) Router {
1096 converted := collectHandlers("add", append([]any{handler}, handlers...)...)
1097 app.register(methods, path, nil, converted...)
1098
1099 return app
1100}
1101
1102// All will register the handler on all HTTP methods
1103func (app *App) All(path string, handler any, handlers ...any) Router {

Callers 12

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
appWithConfigFunction · 0.95

Calls 2

registerMethod · 0.95
collectHandlersFunction · 0.85

Tested by 1

appWithConfigFunction · 0.76