Created
December 28, 2010 15:48
Revisions
-
chooh created this gist
Dec 28, 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 @@ # This is the root of our app @root = File.expand_path(File.join(File.dirname(__FILE__), "www")) run Proc.new { |env| # Extract the requested path from the request req = Rack::Request.new(env) index_file = File.join(@root, req.path_info, "index.html") if File.exists?(index_file) # Rewrite to index req.path_info += "index.html" end # Pass the request to the directory app Rack::Directory.new(@root).call(env) }