Skip to content

Instantly share code, notes, and snippets.

@judearasu
Created October 14, 2012 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judearasu/3887141 to your computer and use it in GitHub Desktop.
Save judearasu/3887141 to your computer and use it in GitHub Desktop.
Serving static sites with rack
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)
]
}
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