Skip to content

Instantly share code, notes, and snippets.

@ravage
Created February 18, 2013 11:24
Show Gist options
  • Save ravage/4976727 to your computer and use it in GitHub Desktop.
Save ravage/4976727 to your computer and use it in GitHub Desktop.
Ruby Rack/Thin serve static files
#!/usr/bin/env ruby
require 'rack'
require 'rack-rewrite'
include Rack
app = Builder.new do
use Rewrite do
rewrite '/', '/index.html'
end
use CommonLogger, STDOUT
run Directory.new(Dir.pwd)
end
puts "Serving #{Dir.pwd}"
Handler::Thin.run app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment