class method
self.dispatch
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
self.dispatch(options = {})
Start the WEBrick server with the given options, mounting the DispatchServlet at /.
Parameters
-
optionsopt = {}
Source
# File railties/lib/webrick_server.rb, line 48
def self.dispatch(options = {})
Socket.do_not_reverse_lookup = true # patch for OS X
params = { :Port => options[:port].to_i,
:ServerType => options[:server_type],
:BindAddress => options[:ip] }
params[:MimeTypes] = options[:mime_types] if options[:mime_types]
server = WEBrick::HTTPServer.new(params)
server.mount('/', DispatchServlet, options)
trap("INT") { server.shutdown }
server.start
end
Defined in railties/lib/webrick_server.rb line 48
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DispatchServlet