-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapplication.rb
60 lines (49 loc) · 1.51 KB
/
application.rb
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# include pry. to start the debugger, put the following anywhere in the code:
# binding.pry
# and as soon you hit that point, a pry shell will be started
require 'bundler/setup'
require 'sinatra'
require 'sinatra/json'
require 'sinatra/streaming'
require 'sinatra/reloader'
require 'cgi'
require 'json'
require 'oj_mimic_json'
require 'fast_blank'
require 'digest/md5'
if File.exists?(".env")
require 'dotenv'
Dotenv.load
end
# RAILS_ENV is set via unicorn in production and used
# by test_helper to also set the environment.
set(:environment, ENV['RAILS_ENV']) unless ENV['RAILS_ENV'].nil?
set :server, :thin
set :port, (ENV['PORT'] || 2343).to_i
set :public_folder, Proc.new { File.join(root, "public") }
# We do not really care about IP spoofing. In fact, it is a good
# way to test.
set :protection, :except => [:frame_options, :ip_spoofing]
set :logging, true
set :static, true
set :raise_errors, true
set :show_exceptions, false
set :dump_errors, true
if settings.environment == :development
require 'pry'
end
Dir[File.join(File.dirname(__FILE__),'config', 'initializers','*.rb')].
each { |a| require_relative a }
use Librato::Rack
require_relative 'lib/ruby_extensions.rb'
require_relative 'lib/exception_handling.rb'
use ExceptionHandling
# initial the view helpers
require_relative 'lib/helpers.rb'
helpers do
include EccrineTracking::Helpers
end
require_relative 'lib/redis_pool.rb'
require_relative 'lib/redis_queue.rb'
require_relative 'routes/pingdom.rb'
require_relative 'routes/tracking.rb'