Skip to content

Instantly share code, notes, and snippets.

@nummi
Created April 9, 2012 19:20
Show Gist options
  • Save nummi/2345825 to your computer and use it in GitHub Desktop.
Save nummi/2345825 to your computer and use it in GitHub Desktop.
Serve static files with Ruby and Rack
require 'rubygems'
require 'rack/rewrite'
use Rack::Rewrite do
rewrite '/', '/index.html'
end
use Rack::Static, :urls => ['/'], :root => "public"
run Rack::Directory.new('public')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment