Created
October 1, 2012 20:17
-
-
Save lucassmagal/3814154 to your computer and use it in GitHub Desktop.
Rack::TryStatic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.setup | |
Bundler.require | |
require 'rack/contrib/try_static' | |
use Rack::TryStatic, | |
:root => "public", # static files root dir | |
:urls => %w[/], # match all requests | |
:try => ['.html', 'index.html', '/index.html'] | |
run lambda { [404, {'Content-Type' => 'text/html'}, ['Not Found']]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment