#from Gnome's Guide to Webrick # A simple WEBrick invocation require 'webrick' server = WEBrick::HTTPServer.new # # You would want to mount handlers here. # Read further to know what # handlers are. # # trap signals to invoke the shutdown procedure cleanly ['INT', 'TERM'].each { |signal| trap(signal){ server.shutdown} } server.start