Created
February 18, 2013 11:24
-
-
Save ravage/4976727 to your computer and use it in GitHub Desktop.
Ruby Rack/Thin serve static files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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