Skip to content

Instantly share code, notes, and snippets.

@hashrock
Created May 6, 2013 04:44
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 hashrock/5523410 to your computer and use it in GitHub Desktop.
Save hashrock/5523410 to your computer and use it in GitHub Desktop.
Minimam Server for Ruby
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