Created
October 14, 2012 03:29
-
-
Save thillain/3887141 to your computer and use it in GitHub Desktop.
Serving static sites with rack
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
use Rack::Static, | |
:urls => ["/assests"], | |
:root => "realest" | |
run lambda { |env| | |
[ | |
200, | |
{ | |
'Content-Type' => 'text/html', | |
'Cache-Control' => 'public, max-age=86400' | |
}, | |
File.open('realest/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 :rubygems | |
gem 'sinatra' | |
gem 'multi_json' | |
gem 'rack' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment