class Sinatra::Base
def route_missing
a NotFound exception. Subclasses can override this method to perform
as middleware (@app is non-nil); when no downstream app is set, raise
implementation is to forward the request downstream when running
No matching route was found or all routes passed. The default
def route_missing if @app forward else raise NotFound end end