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)
| 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`. |
| 1095 | func (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 |
| 1103 | func (app *App) All(path string, handler any, handlers ...any) Router { |