-
-
Save mnewt/3959416 to your computer and use it in GitHub Desktop.
rack static site
This file contains 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
# Static site using Rack (with expire headers and etag support)... great for hosting static sites on Heroku | |
require "bundler/setup" | |
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') |
This file contains 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
source "http://rubygems.org" | |
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