Skip to content
Browse files

better static site serving on heroku

  • Loading branch information...
1 parent cb50476 commit bd62870ce853112c59b65ef272c91b2c6cf6f7cb Chris Moore committed
Showing with 13 additions and 4 deletions.
  1. +3 −1 Gemfile
  2. +2 −0 Gemfile.lock
  3. +8 −3 config.ru
  4. BIN vendor/cache/rack-rewrite-1.3.1.gem
View
4 Gemfile
@@ -5,4 +5,6 @@ gem "sass", "~> 3.2.1"
gem "susy", "~> 1.0.5"
gem "middleman", "~> 3.0.6"
gem 'middleman-smusher'
-gem "compass", "~> 0.12.2"
+gem "compass", "~> 0.12.2"
+
+gem "rack-rewrite", :require => "rack/rewrite"
View
2 Gemfile.lock
@@ -75,6 +75,7 @@ GEM
rack (1.4.1)
rack-protection (1.2.0)
rack
+ rack-rewrite (1.3.1)
rack-test (0.6.2)
rack (>= 1.0)
rake (0.9.2.2)
@@ -118,5 +119,6 @@ DEPENDENCIES
compass (~> 0.12.2)
middleman (~> 3.0.6)
middleman-smusher
+ rack-rewrite
sass (~> 3.2.1)
susy (~> 1.0.5)
View
11 config.ru
@@ -1,4 +1,9 @@
-require 'rubygems'
-require 'middleman'
+require 'rack/rewrite'
-run Middleman.server
+use Rack::Rewrite do
+ rewrite '/', '/index.html'
+ # Uncomment the next line if you want cache-busting URLs and you are NOT using Rack::StaticCache
+ # rewrite %r{^(.+)\-(\d+)\.(js|css|png|jpg|gif|pdf)$}, '$1.$3'
+end
+
+run Rack::Directory.new('build')
View
BIN vendor/cache/rack-rewrite-1.3.1.gem
Binary file not shown.

0 comments on commit bd62870

Please sign in to comment.
Something went wrong with that request. Please try again.