Created
July 26, 2010 08:25
-
-
Save atnan/490309 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 bash | |
function serve() { | |
ruby -rwebrick <<-EOM | |
server = WEBrick::HTTPServer.new({ | |
:Port => 1234, | |
:DocumentRoot => File.expand_path('$1'), | |
:MimeTypes => WEBrick::HTTPUtils::load_mime_types('/etc/apache2/mime.types') | |
}) | |
trap("INT"){ server.shutdown } | |
server.start | |
EOM | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment