forked from crosscite/doi-metadata-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
38 lines (29 loc) · 881 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
Encoding.default_external = Encoding::UTF_8
require 'rubygems'
require 'bundler'
Bundler.require
require 'sass/plugin/rack'
require './app'
require './heartbeat'
# use scss for stylesheets
Sass::Plugin.options[:style] = :compressed
use Sass::Plugin::Rack
# from https://github.com/mperham/sidekiq/wiki/Monitoring
require 'sidekiq'
Sidekiq.configure_client do |config|
config.redis = { size: 1 }
end
require 'sidekiq/web'
Sidekiq::Web.use Rack::Session::Cookie, secret: ENV['RACK_SESSION_COOKIE']
map '/sidekiq' do
use Rack::Auth::Basic, 'Sidekiq Web' do |username, password|
username == ENV['ADMIN_USERNAME'] && password == ENV['ADMIN_PASSWORD']
end
run Sidekiq::Web
end
Sidekiq::Web.instance_eval { @middleware.reverse! } # Last added, First Run
run Rack::URLMap.new(
'/' => Sinatra::Application,
'/heartbeat' => Heartbeat,
'/sidekiq' => Sidekiq::Web
)