class Sinatra::Base

def route_missing

custom route miss logic.
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, "#{request.request_method} #{request.path_info}"
  end
end