Skip to content

Instantly share code, notes, and snippets.

@cliffdarling
Created August 17, 2012 17:04
Show Gist options
  • Save cliffdarling/3380662 to your computer and use it in GitHub Desktop.
Save cliffdarling/3380662 to your computer and use it in GitHub Desktop.
Rack config for static sites
#use this as config.ru to deploy static sites on Heroku
use(Rack::Static, :urls => ["/js", "/css", "/images", "/etc"])
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('index.html', File::RDONLY)
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment