Support for the Ruby 2.4 series has ended. See here for reference.

In Files

  • webrick/httpservlet/prochandler.rb

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