class Rack::Builder

def map(path, &block)

outside the block.
Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement

This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.

end
run App
end
run Heartbeat
use Middleware
map '/heartbeat' do
Rack::Builder.app do

The +use+ method can also be used inside the block to specify middleware to run under a specific path:

end
run App
end
run Heartbeat
map '/heartbeat' do
Rack::Builder.app do

default application specified by run outside the block.
the Rack application specified by run inside the block. Other requests will be sent to the
Creates a route within the application. Routes under the mapped path will be sent to
def map(path, &block)
  @map ||= {}
  @map[path] = block
end