Skip to content

Instantly share code, notes, and snippets.

@felipeclopes
Last active December 15, 2015 23:29
Show Gist options
  • Save felipeclopes/5340877 to your computer and use it in GitHub Desktop.
Save felipeclopes/5340877 to your computer and use it in GitHub Desktop.
Simple rack configuration for static sites and easy heroku deployment!
use Rack::Static,
###################
# Regular expression to include all pages.
# You could also write something like ["index.html", "about_us.html"]
###################
:urls => [/./],
:root => "index.html"
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