invidious-experimenting/src/invidious/routing.cr

12 lines
309 B
Crystal
Raw Normal View History

module Invidious::Routing
{% for http_method in {"get", "post", "delete", "options", "patch", "put", "head"} %}
macro {{http_method.id}}(path, controller, method = :handle)
{{http_method.id}} \{{ path }} do |env|
\{{ controller }}.\{{ method.id }}(env)
end
end
{% end %}
end