Add array of paths support for before/after filters (#605)

This commit is contained in:
Serdar Dogruyol - Sedo セド 2021-04-05 18:24:09 +03:00 committed by GitHub
parent de5e022222
commit 6e72ebb447
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 %}