Skip to content

Instantly share code, notes, and snippets.

@jhbabon
Created September 2, 2012 16:26
Show Gist options
  • Save jhbabon/3601155 to your computer and use it in GitHub Desktop.
Save jhbabon/3601155 to your computer and use it in GitHub Desktop.
Rack configuration for static sites
# encoding: utf-8
use Rack::Static,
:urls => ['/css', '/img', '/js', '/less'],
:root => 'public'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment