module Roda::RodaPlugins::Base::RequestMethods
def root(&block)
Use r.get true to handle +GET+ requests where the current
end
end
# does not match
r.root do
r.on 'foo' do
# => ['GET', '/foo']
[r.request_method, r.remaining_path]
Nor does it match empty paths:
is +/+.
Use r.post "" for +POST+ requests where the current path
end
# does not match
r.root do
# => ['POST', '/']
[r.request_method, r.remaining_path]
Note that this does not match non-+GET+ requests:
end
end
# matches
r.root do
r.on 'foo' do
# => ['GET', '/foo/']
[r.request_method, r.remaining_path]
This is usuable inside other match blocks:
end
# matches
r.root do
# => ['GET', '/']
[r.request_method, r.remaining_path]
the match block returns, the rack response is returned.
path is +/+. If it matches, the match block is executed, and when
Routing matches that only matches +GET+ requests where the current
def root(&block) if remaining_path == "/" && is_get? always(&block) end end