Extract playlist routes from global file

This commit is contained in:
Matthew McGarvey
2020-11-19 19:21:48 -06:00
parent 6ca948ac3c
commit 192d2b86b6
4 changed files with 530 additions and 536 deletions

View File

@@ -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