Skip to content

Instantly share code, notes, and snippets.

@RIAstar
Created August 17, 2013 14:52
Show Gist options
  • Save RIAstar/6257261 to your computer and use it in GitHub Desktop.
Save RIAstar/6257261 to your computer and use it in GitHub Desktop.
[shell,ruby] Start http server in current directory
#oneliner
ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 80, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start"
#alias
alias http="ruby -r webrick -e \"s = WEBrick::HTTPServer.new(:Port => 80, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment