Permalink
Browse files

Part 3 - Prepping for Heroku

  • Loading branch information...
michaelrshannon committed Mar 23, 2015
1 parent 8ebc7cc commit f675c38a2a97128048b0c2797b0bb0f920f55ad3
Showing with 56 additions and 1 deletion.
  1. +6 −1 Gemfile
  2. +12 −0 Gemfile.lock
  3. +1 −0 Procfile
  4. +7 −0 Rakefile
  5. +30 −0 config.ru
  6. 0 source/404.html.erb
@@ -12,4 +12,9 @@ gem 'therubyracer' # faster JS compiles
gem 'oj' # faster JS compiles

gem 'middleman-search_engine_sitemap'
gem 'middleman-minify-html'
gem 'middleman-minify-html'

gem 'puma'
gem 'rack-contrib'
gem 'rack-ssl'
gem 'rack-cache'
@@ -93,7 +93,15 @@ GEM
tilt (~> 1.4.1)
padrino-support (0.12.5)
activesupport (>= 3.1)
puma (2.11.1)
rack (>= 1.1, < 2.0)
rack (1.6.0)
rack-cache (1.2)
rack (>= 0.4)
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-ssl (1.4.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rb-fsevent (0.9.4)
@@ -136,4 +144,8 @@ DEPENDENCIES
middleman-minify-html
middleman-search_engine_sitemap
oj
puma
rack-cache
rack-contrib
rack-ssl
therubyracer
@@ -0,0 +1 @@
web: bundle exec puma -p $PORT
@@ -0,0 +1,7 @@
require 'bundler/setup'

namespace :assets do
task :precompile do
sh 'middleman build'
end
end
@@ -0,0 +1,30 @@
#\ -s puma
require 'rack'
require 'rack/contrib/try_static'
require 'rack/deflater'
require 'rack/cache'

# Forces SSL on all requests
unless ENV['RACK_ENV'] == 'development'
require 'rack/ssl'
use Rack::SSL
end

use Rack::Cache,
:verbose => true,
:metastore => 'file:/var/cache/rack/meta',
:entitystore => 'file:/var/cache/rack/body'

# Enables compression of http responses, used in conjunction with `activate :gzip` in config.rb
use Rack::Deflater

# Serve files from the build directory
use Rack::TryStatic,
root: 'build',
urls: %w[/],
try: %w(.html index.html /index.html)

run lambda { |env|
four_oh_four_page = File.expand_path("../build/404/index.html", __FILE__)
[404, { 'Content-Type' => 'text/html'}, [ File.read(four_oh_four_page) ]]
}
No changes.

0 comments on commit f675c38

Please sign in to comment.