Call closure/controller attached to route
@param uri
@returns {boolean}
493660
function(uri) {
        var route = this.defined(uri);
        if (route !== false) {

            if (this._routes[route].method === null) {
                var f = this._routes[route].handler.bind(this._routes[route].handler);
                f(this.params(route));
            } else {
                var Obj = this._routes[route].handler;
                var method = this._routes[route].method;
                Obj[method](this.params(route));
            }

        } else {
            console.error('Route "' + uri + '" is not defined.');
            return false;
        }
    }
1258872
function setPath(uri) {
  if (uri.path || (uri.pathname === undefined && uri.search === undefined)) return;

  uri.path = '';
  if (uri.pathname) uri.path += uri.pathname;
  if (uri.search) uri.path += uri.search;
}
477680
public function addRoute($method, $uri, callable $handler, $hooks=[])
    {
        $this->routes[] = [$method, $uri, $handler, $hooks];
    }
1166545
private function init($uri, $callback)
    {

        try {
            /**
             * check if there is a general type validation
             * can throw an exception
             */
            $this->validate($uri);

            switch (true) {
                /**
                 * check if the routing maps to an object via array or class
                 */
                case (is_array($callback) || (is_object($callback) && !is_callable($callback))) :
                    $this->setType(self::TYPE_O);
                    $this->strategy = StrategyFactory::make(self::TYPE_O, $callback, new RouteMethodAnnotaionParser());
                    break;

                /**
                 * maps a simple function
                 */
                case (is_string($callback)) :
                    $this->setType(self::TYPE_F);
                    $this->strategy = StrategyFactory::make(self::TYPE_F, $callback);

                    if (!function_exists($callback)) {
                        throw new RouteException(sprintf(_('There is no such Function like %s'), $callback));
                    }
                    break;

                /**
                 * Closure callback
                 */
                case (is_callable($callback)) :
                    $this->setType(self::TYPE_LF);
                    $this->strategy = StrategyFactory::make(self::TYPE_LF, $callback);
                    break;
            }
        } catch (RouteException $e) {
            throw $e;
        }

        return true;
    }
994613
function(method) {
		return function(path,data,callback) {
			if (typeof data === 'object') data = querystring.stringify(data);
			var options = route(path,method,'application/x-www-form-urlencoded',data.length);
			var request = protocol.request(options,response(callback)).on('error',callback);
			request.write(data);
			request.end();
		};
	}
715065
function routeSolver(routeItem, handler, resolver) {
    switch (typeof handler) {
    case 'function':
        // solve as function handler
        registerHandler(routeItem, null, routeItem.handler);
        break;
    case 'string':
        // solve as controller - action handler
        resolver(routeItem, handler);
        break;
    default:
        throw new Error('unknow route type');
    }
}
256109
function (nextRequest) {
    var exit, target, method;

    while(this._exits.length) {
      exit = this._exits.pop();
      target = exit.target;
      method = exit.method;

      if (!(method in target)) {
        throw new Error("Can't call exit " + method + ' on target when changing uri to ' + request.uri);
      }

      target[method].call(target, nextRequest);
    }
  }
1129951
public function addRoute( $uri, $controller_action )
    {
        $routeOptions = [];
        $routeOptions["uri"] = $uri;
        $routeOptions["controller_action"] = $controller_action;

        $routeDefinition = function() use ($routeOptions) {
            return $this->_createRoute( $routeOptions );
        };

        $this->_routeDefinitions[] = $routeDefinition;
    }
240502
function uriToBlob(uri, done) {
  const xhr = new XMLHttpRequest();
  xhr.responseType = "blob";
  xhr.onload = () => {
    const blob = xhr.response;
    done(null, blob);
  };
  xhr.onerror = (err) => {
    done(err);
  };
  xhr.open("GET", uri);
  xhr.send();
}
610442
public function callStaticRoute($uri)
    {
        $params = array_slice($this->getUrlSegments(), 2);

        return $this->callController([$uri, $params]);
    }
1368393
public function execute($uri)
    {
        foreach ($this->routes as $pattern => $callback) {
            if (preg_match($pattern, $uri, $params) === 1) {
                call_user_func_array($this->beforeRouteCallback, $params);
                array_shift($params);

                return call_user_func_array($callback, array_values($params));
            } else {
                error_log("$pattern did not match $uri");
            }
        }
    }
44379
protected function createRoute($methods, $uri, $action)
	{
		// If the route is routing to a controller we will parse the route action into
		// an acceptable array format before registering it and creating this route
		// instance itself. We need to build the Closure that will call this out.
		if ($this->routingToController($action))
		{
			$action = $this->getControllerAction($action);
		}

		$route = $this->newRoute(
			$methods, $uri = $this->prefix($uri), $action
		);

		$route->where($this->patterns);

		// If we have groups that need to be merged, we will merge them now after this
		// route has already been created and is ready to go. After we're done with
		// the merge we will be ready to return the route back out to the caller.
		if (count($this->groupStack) > 0)
		{
			$this->mergeController($route);
		}

		return $route;
	}
972444
public void setImageURI(Uri uri, @Nullable Object callerContext) {
    DraweeController controller =
        mControllerBuilder
            .setCallerContext(callerContext)
            .setUri(uri)
            .setOldController(getController())
            .build();
    setController(controller);
  }
1240940
function buildHttpURL(uri) {
    var port     = weinre_port
    var pathname = weinre_pathname

    if (pathname == "/index.html") pathname = "/"

    if (weinre_protocol == "file:") {
        return uri
    }

    else if (weinre_protocol == "http:") {
        if (port != "") port = ":" + port

        return weinre_protocol + "//" + weinre_host + port + pathname + uri
    }

    else if (weinre_protocol == "https:") {
        if (port != "") port = ":" + port

        return weinre_protocol + "//" + weinre_host + port + pathname + uri
    }
}
1154540
function call(handle, route, err, req, res, next) {
  var arity = handle.length;
  var hasError = Boolean(err);

  debug('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);

  try {
    if (hasError && arity === 4) {
      // error-handling middleware
      handle(err, req, res, next);
      return;
    } else if (!hasError && arity < 4) {
      // request-handling middleware
      handle(req, res, next);
      return;
    }
  } catch (e) {
    // reset the error
    err = e;
  }

  // continue
  next(err);
}
936706
function (methods) {
    this.lazyRouter();
    this.router.method(methods);
    utils.arrayify(methods).forEach(function (method) {
      this.define(method, function(path) {
        var route = this.router.route(path);
        var args = [].slice.call(arguments, 1);
        route[method].apply(route, args);
        return this;
      }.bind(this));
    }.bind(this));
  }
1121910
function(uri) {
        var original_segments = window.location.pathname.split('/');
        var route_segments = uri.split('/');
        var route_length = route_segments.length;
        var params = {};
        for (var i = 1; i < route_length; i++) {
            if (route_segments[i].indexOf('{') !== -1) {
                var name = route_segments[i].substr(1, route_segments[i].length-2);
                params[name] = original_segments[i];
            }
        }
        return params;
    }