Skip to content

Instantly share code, notes, and snippets.

@jackpooley
Last active December 17, 2015 07:58
Show Gist options
  • Select an option

  • Save jackpooley/5576329 to your computer and use it in GitHub Desktop.

Select an option

Save jackpooley/5576329 to your computer and use it in GitHub Desktop.
Serve current directory in with ruby.
#!/usr/bin/env sh
sudo ruby -rwebrick -e "w = WEBrick::HTTPServer.new(:Port => 80, :DocumentRoot => Dir.pwd); %w(TERM INT).each {|s| trap(s) {w.shutdown}};w.start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment