Created
May 18, 2010 11:25
-
-
Save toolmantim/404888 to your computer and use it in GitHub Desktop.
Revisions
-
toolmantim revised this gist
May 18, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class IndexRewriter def initialize(app) @app = app end def call(env) env["PATH_INFO"].gsub! /\/$/, '/index.html' @app.call(env) end end -
toolmantim created this gist
May 18, 2010 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Rackup file for serving up a static site from a "public" directory # # Useful for chucking a static site on Heroku class IndexRewriter def initialize(app) @app = app end def call(env) env["PATH_INFO"] = "/index.html" if env["PATH_INFO"] == "/" @app.call(env) end end use IndexRewriter run Rack::File.new("public")