Skip to content

Instantly share code, notes, and snippets.

@brookr
Created October 27, 2014 04:39
Show Gist options
  • Select an option

  • Save brookr/945d6b8cc3f2bbbf566f to your computer and use it in GitHub Desktop.

Select an option

Save brookr/945d6b8cc3f2bbbf566f to your computer and use it in GitHub Desktop.
serve function
function serve {
port="${1:-4000}"
ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => $port, :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