Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (22 sloc) 0.905 kB
82aaf33 @rwdaigle Add files necessary for Heroku deployment
authored
1 # Rack-rewrite to append "/index.html" to URLs without "."
2 gem 'rack-rewrite', '~> 1.0.0'
3
4 require 'rack/rewrite'
5
6 use Rack::Rewrite do
7 r301 %r{^([^\.]*[^\/])$}, '$1/'
8 r301 %r{^(.*\/)$}, '$1index.html'
9 end
10
11 run Rack::Directory.new('site')
12
13 # use Rack::Static, :urls => ['/stylesheets'], :root => "output"
14 # use Rack::Static, :urls => ["/"], :root => Dir.pwd + "public"
15 # use Rack::Static, :urls => [/./], :root => "public"
16 # use Rack::ETag
17
18 # Empty app, should never be reached:
19 # class Site
20 # def call(env)
21 # [200, {"Content-Type" => "text/html"}, ["Ouch, broken link! Please report to contact@bracket7.com"] ]
22 # end
23 # end
24 #
25 # run Site.new
26
27 # use Rack::Static, :urls => ["/stylesheets", "/images", "/javascripts"], :root => "public"
28 # run lambda { |env| [200, { 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' }, File.open('public/index.html', File::RDONLY)] }
Something went wrong with that request. Please try again.