Skip to content

Instantly share code, notes, and snippets.

@eltiare
Created October 24, 2013 23:11
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 eltiare/7146750 to your computer and use it in GitHub Desktop.
Save eltiare/7146750 to your computer and use it in GitHub Desktop.
A quick and dirty server script written in Ruby
#!/usr/bin/env ruby
require 'webrick'
include WEBrick
port = ARGV[0] || 4567
puts "Starting server: http://#{Socket.gethostname}:#{port}"
server = HTTPServer.new(:Port=>port,:DocumentRoot=>Dir::pwd )
trap("INT"){ server.shutdown }
server.start
@eltiare
Copy link
Author

eltiare commented Oct 25, 2013

Put this script somewhere in your path (like /usr/local/bin) and assign executable privileges to it (chmod +x /usr/local/bin/ss)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment