Alternative (stricter) router strategy for Strelka::App::Routing plugin.
class MyApp < Strelka::App plugins :routing router :exclusive # Unlike the default router, this route will *only* respond to # a request that matches the app's route with no additional path. get '' do # ... end end # class MyApp
Add a route for the specified
options that will return
action when a request
# File lib/strelka/router/exclusive.rb, line 40 def add_route( verb, path, route ) re = Regexp.compile( '^' + path.join('/') + '$' ) # Make the Hash for the specified HTTP verb if it hasn't been created already self.routes[ re ][ verb ] = route end