Skip to content

Instantly share code, notes, and snippets.

@atnan
Created July 26, 2010 08:25
Show Gist options
  • Save atnan/490309 to your computer and use it in GitHub Desktop.
Save atnan/490309 to your computer and use it in GitHub Desktop.
#!/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