Class: WEBrick::HTTPServlet::ProcHandler (Ruby 2.3.4)

In Files

  • webrick/httpservlet/prochandler.rb

Class/Module Index [+]

Quicksearch

WEBrick::HTTPServlet::ProcHandler

Mounts a proc at a path that accepts a request and response.

Instead of mounting this servlet with WEBrick::HTTPServer#mount use WEBrick::HTTPServer#mount_proc:

server.mount_proc '/' do |req, res|
  res.body = 'it worked!'
  res.status = 200
end