-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.ru
34 lines (31 loc) · 853 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
# frozen_string_literal: true
require 'rake'
case ENV.fetch('RACK_ENV', nil)
when 'production', 'staging'
require 'rollbar'
Rollbar.configure do |config|
config.access_token = '0302f64ea01249dfb3084cb21eae862c'
config.enabled = true
end
require_relative 'app'
logger = Logger.new $stdout
logger.level = Logger::DEBUG
run App.freeze.app
when 'test'
require 'dotenv/load'
require 'pry'
require_relative 'app'
logger = Logger.new('logger.log', 'daily')
logger.level = Logger::DEBUG
run App.freeze.app
else
require 'dotenv/load'
require 'logger'
require 'pry'
require 'rack/unreloader'
logger = Logger.new $stdout
logger.level = Logger::DEBUG
Unreloader = Rack::Unreloader.new(subclasses: %w[Roda Sequel::Model], logger:, reload: true) { App }
Unreloader.require('app.rb') { 'App' }
run Unreloader
end