Skip to content

Instantly share code, notes, and snippets.

@grantmichaels
Forked from rmanalan/.gems
Created February 1, 2010 21:04
Show Gist options
  • Save grantmichaels/292029 to your computer and use it in GitHub Desktop.
Save grantmichaels/292029 to your computer and use it in GitHub Desktop.
# Static site using Rack (with expire headers and etag support)... great for hosting static sites on Heroku
require File.dirname(__FILE__) + '/vendor/gems/environment'
Bundler.require_env
require 'rack/contrib'
require 'rack-rewrite'
use Rack::StaticCache, :urls => ['/images','/css','/favicon.ico'], :root => "public"
use Rack::ETag
use Rack::Rewrite do
rewrite '/', '/index.html'
end
run Rack::Directory.new('public')
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment