What does the WEBrick instance method mount_proc do (in plain English)?
The docs say:
mount_proc(dir, proc=nil, &block)
Mounts proc or block on dir and calls it with a WEBrick::HTTPRequest and WEBrick::HTTPResponse
but I'm not clear what mounts proc on dir actually means or does.
mount_procallows you to specify a piece of code (a proc) that will be run when a request comes in. Here's a simple hello world example adapted from the Ruby documentationnow point your browser to
http://localhost:8000and you should see