forked from exercism/exercism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
38 lines (30 loc) · 840 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
require "English"
$LOAD_PATH.unshift File.expand_path("./..", __FILE__)
$LOAD_PATH.unshift File.expand_path("./../lib", __FILE__)
require 'bundler'
Bundler.require
I18n.enforce_available_locales = false
if ENV['RACK_ENV'] == 'development'
require 'active_record'
require 'db/connection'
DB::Connection.establish
if defined?(ActiveRecord::Migrator) && ActiveRecord::Migrator.needs_migration?
fail 'Migrations are pending run `rake db:migrate` to resolve the issue.'
end
end
if ENV['RACK_ENV'] != 'production'
require 'dotenv'
Dotenv.load
end
require 'app'
require 'flipper_app'
require 'api/v1'
ENV['RACK_ENV'] ||= 'development'
use Rack::MethodOverride
run Rack::URLMap.new(
"/" => ExercismWeb::App,
"/flipper" => Flipper::UI.app($flipper, &FlipperApp.generator)
)
map '/api/v1/' do
run ExercismAPI::App
end