Created
June 4, 2012 15:33
-
-
Save ntulip/2869069 to your computer and use it in GitHub Desktop.
Revisions
-
ntulip created this gist
Jun 4, 2012 .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,25 @@ # From http://anti-pattern.com/2012/6/2/static-sites-on-heroku # Gemfile source "http://rubygems.org" gem "rack" # config.ru require "rubygems" require "bundler" Bundler.require(:default) map "/" do use Rack::Static, urls: ["/assets"], root: Dir.pwd run lambda { |env| headers = { "Content-Type" => "text/html", "Cache-Control" => "public, max-age=86400" } body = File.open("#{Dir.pwd}/index.html", File::RDONLY).read [200, headers, [body]] } end