Created
November 5, 2009 05:54
-
-
Save sms420/226806 to your computer and use it in GitHub Desktop.
server
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/local/bin/ruby1.9 -w | |
| # | |
| # server | |
| # web | |
| # | |
| # Created by GlenC on 2009-10-31. | |
| # Copyright 2009 glenc.com. All rights reserved. | |
| # Modified by SMS420 on 2009-11-04 dude | |
| require 'webrick' | |
| include WEBrick | |
| $port = ARGV[0].to_i | |
| $directory = ARGV[1] | |
| s = HTTPServer.new( | |
| :Port => $port, | |
| :DocumentRoot => File.join(Dir.pwd, $directory) | |
| ) | |
| trap("INT") {s.shutdown} | |
| s.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment