mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-19 19:38:51 +00:00
16 lines
421 B
Crystal
16 lines
421 B
Crystal
module Invidious::Routing
|
|
macro get(path, controller, method = :handle)
|
|
get {{ path }} do |env|
|
|
controller_instance = {{ controller }}.new(config)
|
|
controller_instance.{{ method.id }}(env)
|
|
end
|
|
end
|
|
|
|
macro post(path, controller, method = :handle)
|
|
post {{ path }} do |env|
|
|
controller_instance = {{ controller }}.new(config)
|
|
controller_instance.{{ method.id }}(env)
|
|
end
|
|
end
|
|
end
|