Skip to content

Instantly share code, notes, and snippets.

@lucassmagal
Created October 1, 2012 20:17
Show Gist options
  • Save lucassmagal/3814154 to your computer and use it in GitHub Desktop.
Save lucassmagal/3814154 to your computer and use it in GitHub Desktop.
Rack::TryStatic
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