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)
| 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`. |
| 173 | func (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 |
| 184 | func (grp *Group) All(path string, handler any, handlers ...any) Router { |