Skip to content

Instantly share code, notes, and snippets.

@davidrobert
Created August 10, 2012 18:35
Show Gist options
  • Save davidrobert/3316564 to your computer and use it in GitHub Desktop.
Save davidrobert/3316564 to your computer and use it in GitHub Desktop.
deploy static page on heroku
#
# deploy a static page on heroku
# ------------------------------
#
#
# required site structure:
#
# name-of-site
# |- config.ru
# +- public
# |- index.html
# |- css
# |- js
# +- images
#
#
#
# deployment:
#
# git init
# ...
# heroku create <name-of-site>
# git push heroku master
#
#
use Rack::Static, :urls => ["/css", "/images", "/js"], :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