forked from midou/invidious
7afa027b95
* Switch routing logic to use modules * Add more macros for adding routes of different HTTP methods
12 lines
309 B
Crystal
12 lines
309 B
Crystal
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
|