mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-16 01:48:51 +00:00
Extract playlist routes from global file
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
module Invidious::Routing
|
||||
macro get(path, controller)
|
||||
macro get(path, controller, method = :handle)
|
||||
get {{ path }} do |env|
|
||||
controller_instance = {{ controller }}.new(config, logger)
|
||||
controller_instance.handle(env)
|
||||
controller_instance.{{ method.id }}(env)
|
||||
end
|
||||
end
|
||||
|
||||
macro post(path, controller, method = :handle)
|
||||
post {{ path }} do |env|
|
||||
controller_instance = {{ controller }}.new(config, logger)
|
||||
controller_instance.{{ method.id }}(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user