Make config a constant

Instead of passing around `config` there is now the global `CONFIG`.
This commit is contained in:
saltycrys
2021-01-23 19:39:04 +01:00
parent f1a7ee997b
commit b45f371911
14 changed files with 97 additions and 113 deletions

View File

@@ -1,14 +1,14 @@
module Invidious::Routing
macro get(path, controller, method = :handle)
get {{ path }} do |env|
controller_instance = {{ controller }}.new(config)
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(config)
controller_instance = {{ controller }}.new
controller_instance.{{ method.id }}(env)
end
end