Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Part 3 - Prepping for Heroku
- Loading branch information
1 parent
8ebc7cc
commit f675c38
Showing
6 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: bundle exec puma -p $PORT |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'bundler/setup' | ||
|
||
namespace :assets do | ||
task :precompile do | ||
sh 'middleman build' | ||
end | ||
end |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) ]] | ||
} |
Empty file.