-
-
Save eltiare/7146750 to your computer and use it in GitHub Desktop.
A quick and dirty server script written in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this script somewhere in your path (like /usr/local/bin) and assign executable privileges to it (chmod +x /usr/local/bin/ss)