Created
February 20, 2014 19:57
-
-
Save stevenschobert/9121925 to your computer and use it in GitHub Desktop.
Starter set of files for a simple rack app. Useful for quickly deploying static sites to something like Heroku, or using Pow for editing static sites.
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 characters
| require 'rack' | |
| root = "public" | |
| use Rack::Static, | |
| :urls => Dir.glob("#{root}/*").map { |fn| fn.gsub(/#{root}/, '')}, | |
| :root => root, | |
| :index => 'index.html', | |
| :header_rules => [[:all, {'Cache-Control' => 'public, max-age=3600'}]] | |
| run Proc.new {|env| | |
| [ | |
| 200, | |
| {"Content-Type" => "text/html"}, | |
| File.open('public/index.html', File::RDONLY) | |
| ] | |
| } |
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 characters
| source 'https://rubygems.org' | |
| ruby '2.0.0' | |
| gem 'rack' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment