Created
December 1, 2012 09:55
-
-
Save x2q/4181366 to your computer and use it in GitHub Desktop.
simple and fast Ruby/Rack/Thin setup for a serving static html site with ssl support
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
require 'rack/contrib/try_static' | |
require 'rack/ssl-enforcer' | |
if ENV['RACK_ENV'] == 'production' | |
use Rack::SslEnforcer | |
end | |
use Rack::TryStatic, | |
:root => "public", | |
:urls => %w[/], | |
:try => ['.html', 'index.html', '/index.html'] | |
run lambda { [404, {'Content-Type' => 'text/html'}, ['Not Found']]} |
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
source :rubygems | |
gem 'rack-contrib' | |
gem 'thin' | |
gem 'rack-ssl-enforcer' |
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
web: bundle exec thin start -p $PORT -e $RACK_ENV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment