-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.ru
More file actions
22 lines (17 loc) · 732 Bytes
/
config.ru
File metadata and controls
22 lines (17 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'sinatra'
require 'active_support/core_ext/hash/keys'
require 'active_support/core_ext/numeric/time'
require 'json'
require 'open-uri'
require 'yaml'
YAML.load(File.read('./config/config.yml'))[ENV['RACK_ENV'] || 'development'].each do |key, value|
ENV.store(key, value)
end
ENV['api_key'] ||=
YAML.load(File.read('./config/secrets.yml'))[ENV['RACK_ENV'] || 'development']['api_key']
ENV['request_base'] =
"#{ENV['api_base']}?key=#{ENV['api_key']}&part=contentDetails&maxResults=50"
# TODO warum failt das manchmal auf heroku only? reihenfolge!
# warum geht dann autoload auch nicht (siehe tamyca_core)
Dir.glob('./app/controllers/*.rb').sort.each { |file| require file }
map('/') { run RedirectController }