forked from rob-mcgrail/ab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
44 lines (31 loc) · 866 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
39
40
41
42
#
# http://rack.rubyforge.org/doc/
#
# http://www.sinatrarb.com/intro#Using%20a%20Classic%20Style%20Application%20with%20a%20config.ru
#
# Starting up the app example:
#
# $ rackup -p 9000 -s mongrel config.ru
#
# Include sinatra now so we can call on settings.
require 'rubygems'
require 'sinatra'
require 'app'
#
# Serve assets locally in development mode;
# should be served via reverse proxy in
# production mode.
#
# http://rack.rubyforge.org/doc/classes/Rack/Static.html
#
use Rack::NoIE6
if settings.development?
use Rack::Static, :urls => ['/stylesheets', '/javascript', '/logs', '/images', 'robots.txt'], :root => "public"
end
# Authentication middleware
#https://github.com/hassox/warden/wiki/overview
use Warden::Manager do |mgmt|
mgmt.default_strategies :password
mgmt.failure_app = Sinatra::Application
end
run Sinatra::Application