Route -------------- ===================== 
@constructor
507027
function Route(pattern, callback, priority, router) {
        var isRegexPattern = isRegExp(pattern),
            patternLexer = router.patternLexer;
        this._router = router;
        this._pattern = pattern;
        this._paramsIds = isRegexPattern? null : patternLexer.getParamIds(pattern);
        this._optionalParamsIds = isRegexPattern? null : patternLexer.getOptionalParamsIds(pattern);
        this._matchRegexp = isRegexPattern? pattern : patternLexer.compilePattern(pattern, router.ignoreCase);
        this.matched = new signals.Signal();
        this.switched = new signals.Signal();
        if (callback) {
            this.matched.add(callback);
        }
        this._priority = priority || 0;
    }
170776
protected function mapRoutes()
    {
        if (!$this->app->routesAreCached()) {
            Route::group(
                ['middleware' => ['web']], function () {
                    $routes = new Routes();

                    // Backend Routes
                    $routes->mapBackendRoutes()
                        ->mapPluginsBackendRoutes();

                    // Frontend Routes
                    $routes->mapFrontendBaseRoutes()
                        ->mapFrontendRoutes()
                        ->mapThemeRoutes()
                        ->mapPluginsFrontendRoutes();

                    // Add Language {lang} prefix
                    $routes->addLanguagePrefix()
                        ->sortRoutes();
                }
            );
        }
    }
737384
function _buildRoute(route) {

  let newRoute = route;

  // Normalize the route string
  newRoute = (newRoute.indexOf('/') === 0) ? newRoute.slice(1, newRoute.length) : newRoute;
  newRoute = '/' + newRoute;

  // Prepend the root if the user defined one
  newRoute = (Nasa.__config__['root']) ? Nasa.__config__['root'] + newRoute : newRoute;

  return newRoute;
}
868802
function route(method, path, handler, config) {

    if( (typeof method !== 'string' && !Array.isArray(method))
        || (typeof path !== 'string')
        || (typeof handler !== 'function' && typeof handler !== 'string' && typeof handler !== 'object')
        || (config != null && typeof config !== 'object') ) {
        throw new TypeError('Bad arguments');
    }

    if (typeof method === 'string') {
        method = method.toUpperCase().replace(/\s+/g, ' ').trim().replace(/^DEL$/, 'DELETE');
        if (method.match(/ /)) {
            method = method.split(' ');
        }
    }
    if (Array.isArray(method)) {
        method = method.map(function (x) {
            return x.toUpperCase().replace(/\s+/g, ' ').trim().replace(/^DEL$/, 'DELETE');
        });
        method.forEach(function (elem) {
            if (elem.match(/[^A-Z*]/)) {
                throw new TypeError('Bad arguments');
            }
        });
    }
    return {
        method: method,
        path: path,
        handler: handler,
        config: config
    };
}
1339232
public function route($request)
    {
        if (!self::$_cli) {
            $router = $this->get('routing');
            $router->route($request);
        }
    }
882183
function Router() {
  var self = this;
  this._routes = {};

  this.middleware = function(req, res, next) {
    self._dispatch(req, res, next);
  };
}
884006
function Router(req, res, next) {
        const server = this;
        const state = {
            method: req.method.toUpperCase(),
            params: {},
            routes: routes.concat(),
            routeUnhandled: true,
            server: server,
        };
        run(state, req, res, err => {
            req.params = {};
            if (state.routeUnhandled) req.log('unhandled', 'Router had no matching paths');
            next(err);
        });
    }
1350141
public function route()
	{
		$content = $this->_controller->{$this->_actionMethod}();

		if ($this->_controller->isJson()) {
			Request::setHeader(Request::HEADER_JSON);
			echo json_encode($content);
		} else {
			echo $content;
		}
	}
450120
function(uri) {
        if (this.defined(uri)) {
            history.pushState(null, null, uri);
            var event = new CustomEvent('onRouteChange');
            event.route = uri;
            document.dispatchEvent(event, uri);
        } else {
            console.error('Route "' + uri + '" is not defined.');
            return false;
        }
    }
582236
function () {
    var propType;

    // Route config type.
    propType = getPropertyType(this.el, this.data.property);
    if (isRawProperty(this.data) && this.data.type === TYPE_COLOR) {
      this.updateConfigForRawColor();
    } else if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {
      this.updateConfigForVector();
    } else {
      this.updateConfigForDefault();
    }
  }
767273
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {

            /*
             * Front office routes
             */
            if ($page = TypiCMS::getPageLinkedToModule('news')) {
                $router->middleware('public')->group(function (Router $router) use ($page) {
                    $options = $page->private ? ['middleware' => 'auth'] : [];
                    foreach (locales() as $lang) {
                        if ($page->translate('status', $lang) && $uri = $page->uri($lang)) {
                            $router->get($uri, $options + ['uses' => 'PublicController@index'])->name($lang.'::index-news');
                            $router->get($uri.'.xml', $options + ['uses' => 'PublicController@feed'])->name($lang.'::news-feed');
                            $router->get($uri.'/{slug}', $options + ['uses' => 'PublicController@show'])->name($lang.'::news');
                        }
                    }
                });
            }

            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('news', 'AdminController@index')->name('admin::index-news')->middleware('can:see-all-news');
                $router->get('news/create', 'AdminController@create')->name('admin::create-news')->middleware('can:create-news');
                $router->get('news/{news}/edit', 'AdminController@edit')->name('admin::edit-news')->middleware('can:update-news');
                $router->post('news', 'AdminController@store')->name('admin::store-news')->middleware('can:create-news');
                $router->put('news/{news}', 'AdminController@update')->name('admin::update-news')->middleware('can:update-news');
            });

            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('news', 'ApiController@index')->middleware('can:see-all-news');
                    $router->patch('news/{news}', 'ApiController@updatePartial')->middleware('can:update-news');
                    $router->delete('news/{news}', 'ApiController@destroy')->middleware('can:delete-news');

                    $router->get('news/{news}/files', 'ApiController@files')->middleware('can:update-news');
                    $router->post('news/{news}/files', 'ApiController@attachFiles')->middleware('can:update-news');
                    $router->delete('news/{news}/files/{file}', 'ApiController@detachFile')->middleware('can:update-news');
                });
            });
        });
    }
1210355
function Route(path) {
  this.path = path;
  this.stack = [];
  this.handle = compose(this.stack);

  debug('new %s', path);

  // route handlers for various http methods
  this.methods = {};
}
622078
public function hook($route)
    {
        $route->setURLHandler([$this,'onURL']); //todo once ?
        
        $route->path_info=$this->adjustPathinfo($route->path_info, $route->document_root);
        $route->calling_path=$route->path_info;
    }
742006
function (route, parameters) {

        return new Promise((resolve, reject) => {

            request.get({
                url: baseUrl + route + '?' + querystring.stringify(parameters)
            }, (error, response, body) => {

                if (error) {
                    reject(error);
                } else if (response && body) {
                    var result;

                    try {
                        result = JSON.parse(body);
                    } catch (e) {
                        reject(e);
                    }

                    if (result.error == 'Method not allowed') {
                        this._post(route, parameters).then(
                            res => { resolve(res) },
                            err => { reject(err) }
                        );
                    } else {
                        resolve(result);
                    }
                } else {
                    reject(response);
                }
            });
        });
    }
405482
public function route($route = null)
    {
        if (null === $route) {
            return $this->route;
        }
        $this->route = $route;

        return $this;
    }
1085669
function route($path = '/', array $actions = [], $method = Router::ANY_METHOD, $name = '')
    {
        $this->path($path);
        $this->actions[$method] = $actions;
        $this->name = $name;

        return $this;
    }
428462
function(route, args, base) {
            base = base || "";
            args = args || {};
            var url = route;
            url = url.replace("#!/","#").replace("#!", "#").replace("#", "");
            _.map(args, function(value, attr) {
                url = url.replace("\:"+attr, value);
            });
            return base+"#/"+url;
        }