forked from exercism/exercism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
33 lines (26 loc) · 763 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
$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 'api/v1'
ENV['RACK_ENV'] ||= 'development'
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use Rack::MethodOverride
run ExercismWeb::App
map '/api/v1/' do
run ExercismAPI::App
end