Created
September 19, 2013 11:51
-
-
Save herry13/6622295 to your computer and use it in GitHub Desktop.
Simple Ruby HTTP 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/bin/env ruby | |
| require 'webrick' | |
| server = WEBrick::HTTPServer.new :Port => 80 | |
| dir = (ARGV.length > 0 ? ARGV[0] : './') | |
| server.mount "/", WEBrick::HTTPServlet::FileHandler, dir | |
| trap('INT') { server.stop } | |
| server.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment