Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: patch-1
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (12 sloc) 0.508 kB
$stdout.sync = true
require 'rack/contrib/try_static'
use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html', 'index.html', '/index.html']
# Run your own Rack app here or use this one to serve 404 messages:
run lambda{ |env|
not_found_page = File.expand_path("../build/404.html", __FILE__)
if File.exist?(not_found_page)
[ 404, { 'Content-Type' => 'text/html'}, [File.read(not_found_page)] ]
else
[ 404, { 'Content-Type' => 'text/html' }, ['404 - page not found'] ]
end
}
Jump to Line
Something went wrong with that request. Please try again.