Skip to content

Instantly share code, notes, and snippets.

@irohiroki
Created October 20, 2011 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irohiroki/1300090 to your computer and use it in GitHub Desktop.
Save irohiroki/1300090 to your computer and use it in GitHub Desktop.
webrick oneliner function
function webrick {
if [ -z "$1" ] ; then
port=3333
else
port=$1
fi
ruby -rwebrick -e "WEBrick::HTTPServer.new(:DocumentRoot => './', :Port => ${port}).tap{|w| Signal.trap(:INT){w.shutdown()} }.start"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment