Created
May 6, 2013 04:44
-
-
Save hashrock/5523410 to your computer and use it in GitHub Desktop.
Minimam Server for Ruby
This file contains 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
require 'webrick' | |
server = WEBrick::HTTPServer.new(:DocumentRoot => Dir.pwd, :Port => 3000) | |
['INT', 'TERM'].each do |signal| | |
trap(signal){ server.shutdown } | |
end | |
server.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment