From 0e84dd062892768689e59cab17f90961931c3244 Mon Sep 17 00:00:00 2001 From: Todd Eichel Date: Wed, 27 Jan 2010 11:27:29 -0500 Subject: [PATCH] Basic Rack app for serving static files out of /public. --- Gemfile | 1 + config.ru | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 Gemfile create mode 100644 config.ru diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..982f727 --- /dev/null +++ b/Gemfile @@ -0,0 +1 @@ +gem 'rack-rewrite' diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..d9d8535 --- /dev/null +++ b/config.ru @@ -0,0 +1,12 @@ +# Static site using Rack (with expire headers and etag support)... great for hosting static sites on Heroku +# From: http://manalang.com/static-websites-with-heroku + +require File.dirname(__FILE__) + '/vendor/gems/environment' +Bundler.require_env +require 'rack-rewrite' + +use Rack::Rewrite do + rewrite '/', '/index.html' +end + +run Rack::Directory.new('public')