-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
43 lines (31 loc) · 988 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
40
41
42
require File.expand_path('../config/environment', __FILE__)
#Rack::Handler::Thin.run(Piecemaker::App.instance) do |server|
# server.ssl = true
# server.ssl_options = {
# # :private_key_file => '/path/to/foo.key',
# # :cert_chain_file => '/path/to/bar.crt',
# :verify_peer => false,
# }
#end
# use Rack::SslEnforcer
use Rack::Deflater
use Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any,
:methods => [:get, :post, :put, :delete, :options]
end
end
if ENV['ENABLE_NEWRELIC']
puts "Loading NewRelic ..."
require 'newrelic_rpm'
require 'new_relic/rack/developer_mode'
puts "NewRelic Developer Mode: " + ENV["NEWRELIC_DEVELOPER"]
puts "NewRelic Monitor Mode: " + ENV["NEWRELIC_MONITOR"]
if ENV["NEWRELIC_MONITOR"] and not ENV['NEWRELIC_LICENSE_KEY']
puts "Error: Missing NewRelic license key in config!"
end
use NewRelic::Rack::DeveloperMode
NewRelic::Agent.manual_start
end
run Piecemaker::API