-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.ru
25 lines (19 loc) · 837 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
# encoding: UTF-8 (magic comment)
# This file is used, for example, when deploying with Apache and Phusion
# Passenger.
#
# Some documentation:
#
# * https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
# * http://www.sinatrarb.com/intro.html#When%20to%20use%20a%20config.ru?
require 'bundler'
# ENV['RACK_ENV'] = 'production'
Bundler.setup(:default, ENV['RACK_ENV'])
require File.expand_path('application.rb', File.dirname(__FILE__))
# This seems to be needed to automatically close connections at the end of
# each request. Not sure if and how this works. This does not work when
# the applicaiton is run from the command line with "Thin" web server.
# For that case, connections need to be closed explicitely in an "after"
# filter.
use ActiveRecord::ConnectionAdapters::ConnectionManagement
run CTT2013::Application.new