-
-
Save thejandroman/9078631 to your computer and use it in GitHub Desktop.
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 'webrick' | |
include WEBrick | |
# add custom MIME types | |
#HTTPUtils::DefaultMimeTypes.store('swf', 'application/x-shockwave-flash') | |
port = 8081 | |
path = File.expand_path((ARGV[0].nil?) ? File.dirname(__FILE__) : ARGV[0]) | |
STDERR.puts "#{$0}: port #{port} serving \"#{path}\"" | |
server = HTTPServer.new(:Port => port, :DocumentRoot => path, :DocumentRootOptions => {:FancyIndexing => true}) | |
trap("INT"){ server.shutdown } | |
server.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment