Add array of paths support for before/after filters (#605)
This commit is contained in:
parent
de5e022222
commit
6e72ebb447
1 changed files with 6 additions and 0 deletions
|
@ -33,5 +33,11 @@ end
|
|||
def {{type.id}}_{{method.id}}(path : String = "*", &block : HTTP::Server::Context -> _)
|
||||
Kemal::FilterHandler::INSTANCE.{{type.id}}({{method}}.upcase, path, &block)
|
||||
end
|
||||
|
||||
def {{type.id}}_{{method.id}}(paths : Array(String), &block : HTTP::Server::Context -> _)
|
||||
paths.each do |path|
|
||||
Kemal::FilterHandler::INSTANCE.{{type.id}}({{method}}.upcase, path, &block)
|
||||
end
|
||||
end
|
||||
{% end %}
|
||||
{% end %}
|
||||
|
|
Loading…
Reference in a new issue