-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.ru
41 lines (32 loc) · 978 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env ruby
if ENV['VOOM_ENV'] == 'integration_testing'
require 'simplecov'
if ENV['CIRCLE_ARTIFACTS']
dir = File.join(ENV['CIRCLE_ARTIFACTS'], "coverage")
SimpleCov.coverage_dir(dir)
end
SimpleCov.start
end
ENV['VOOM_ROOT'] = File.expand_path(__dir__)
ENV['GOOGLE_API_KEY'] = 'AIzaSyDhSgj9XSBLY5E9Rx5pP2ILQ7IXnD4uX2Q'
require 'voom'
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [:get, :post, :options]
end
end
Voom::Presenters::Settings.configure do |config|
config.presenters.root = File.join(ENV['VOOM_ROOT'], 'app')
config.presenters.web_client.prepare_context << ->(context, session, _env) {
context.merge(session: session)
}
end
use Voom::Presenters::Demo::Search
use Voom::Presenters::Demo::Echo
use Voom::Presenters::Demo::Slow
use Voom::Presenters::Demo::DragonDrop
use Voom::Presenters::WebClient::App
run Voom::Presenters::Api::App
Voom::Presenters::App.boot!