2020-10-06 10:11:18 +05:30
|
|
|
module Invidious::Routing
|
2020-11-20 06:51:48 +05:30
|
|
|
macro get(path, controller, method = :handle)
|
2020-10-06 10:11:18 +05:30
|
|
|
get {{ path }} do |env|
|
2021-01-04 21:21:06 +05:30
|
|
|
controller_instance = {{ controller }}.new(config)
|
2020-11-20 06:51:48 +05:30
|
|
|
controller_instance.{{ method.id }}(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
macro post(path, controller, method = :handle)
|
|
|
|
post {{ path }} do |env|
|
2021-01-04 21:21:06 +05:30
|
|
|
controller_instance = {{ controller }}.new(config)
|
2020-11-20 06:51:48 +05:30
|
|
|
controller_instance.{{ method.id }}(env)
|
2020-10-06 10:11:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|