mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
b45f371911
Instead of passing around `config` there is now the global `CONFIG`.
15 lines
405 B
Crystal
15 lines
405 B
Crystal
module Invidious::Routing
|
|
macro get(path, controller, method = :handle)
|
|
get {{ path }} do |env|
|
|
controller_instance = {{ controller }}.new
|
|
controller_instance.{{ method.id }}(env)
|
|
end
|
|
end
|
|
|
|
macro post(path, controller, method = :handle)
|
|
post {{ path }} do |env|
|
|
controller_instance = {{ controller }}.new
|
|
controller_instance.{{ method.id }}(env)
|
|
end
|
|
end
|
|
end
|