-
-
Save czottmann/15666dac3cf4b5b2f8c4 to your computer and use it in GitHub Desktop.
Serving a static site on Heroku. Assumes a `public/` folder in the same directory as these files are.
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
require 'rack/rewrite' | |
use Rack::Rewrite do | |
r301 %r{(.*)}, '$1/', :not => %r{\.|/$} | |
rewrite %r{(.*)/$}, '$1/index.html' | |
end | |
use Rack::Deflater | |
use Rack::Static, :urls => [/./], :root => "public", :index => "index.html" | |
run Proc |
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 :rubygems | |
gem "rack" | |
gem "rack-rewrite", "~> 1.2.1" |
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
web: bundle exec rackup config.ru -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment