>>> from torext.route import include
        >>> app = TorextApp()
        >>> app.route_many([
        ...     ('/account', include('account.views')),
        ...     ('/account', include('account.views')),
        ... ], '^account.example.com$')
438590
def route_many(self, *args, **kwargs):
        
        if len(args) == 2:
            prefix, rules = args
        elif len(args) == 1:
            prefix = None
            rules = args[0]
        else:
            raise ValueError('The amount of args of route_many method can only be one or two')
        router = Router(rules, prefix=prefix)
        self.add_handlers(router.get_handlers(), host=kwargs.get('host'))
384319
function processRoute(route, tags) {
                var routes = resolver.transformRoute(route);

                if (routes.routeTrailingSlash) {
                    self._addAppRouteHandler('GET', routes.routeTrailingSlash, route, tags);
                    self._addAppRouteHandler('POST', routes.routeTrailingSlash, route, tags);
                }

                self._addAppRouteHandler('GET', routes.route, route, tags);
                self._addAppRouteHandler('POST', routes.route, route, tags);
            }
803191
def _parse_routes(iface, opts):
    '''
    
    '''
    # Normalize keys
    opts = dict((k.lower(), v) for (k, v) in six.iteritems(opts))
    result = {}
    if 'routes' not in opts:
        _raise_error_routes(iface, 'routes', 'List of routes')

    for opt in opts:
        result[opt] = opts[opt]

    return result
756524
def p_route(self, p):
        """"""
        p[0] = AstRouteDef(self.path, p.lineno(1), p.lexpos(1), p[2], p[3], p[5], *p[4])
        if len(p) > 7:
            p[0].set_doc(p[8])
            if p[9]:
                keys = set()
                for attr in p[9]:
                    if attr.name in keys:
                        msg = "Attribute '%s' defined more than once." % attr.name
                        self.errors.append((msg, attr.lineno, attr.path))
                    keys.add(attr.name)
                p[0].set_attrs(p[9])
645985
def get_urls(self):
        
        parts = []
        seen = set()

        # Process item views in order
        for v in list(self._meta.item_views)+list(self._meta.action_views):
            if not v in seen:
                view, name = self.get_view_and_name(v)
                if view and name:
                    parts.append(self.get_url(name, view, v))
                seen.add(v)

        # Process everything else that we have not seen
        for v in set(self._views).difference(seen):
            # Get the url name
            view, name = self.get_view_and_name(v)
            if view and name:
                parts.append(self.get_url(name, view, v))

        return parts
732397
protected function initRoutes()
    {
        if (isset($this->settings) && $this->settings->exists('routes') || !self::$init_stages[$this->name]['routes']) {

            $routes = $this->settings->get('routes');

            // Get uncamelized app name
            $string = new CamelCase($this->name);
            $app = $string->uncamelize();

            // Add always a missing index route!
            if (!array_key_exists('index', $routes)) {
                $routes['index'] = [];
            }

            foreach ($routes as $name => $definition) {

                if (is_numeric($name)) {
                    Throw new AppException(sprintf('AbstractApp "%s" sent a nameless route to be mapped.', $this->name));
                }

                $definition = $this->parseRouteDefintion($name, $definition);

                $this->core->router->map($definition['method'], $definition['route'], $definition['target'], $definition['name']);
            }

            self::$init_stages[$this->name]['routes'] = true;
        }
    }
706092
def add_route(route, endpoint=None, **kw):
    
    def wrapper(f):
        try:
            router.DefaultRouter.add_url_rule(route,
                                              endpoint=endpoint,
                                              view_func=f,
                                              options=kw)
        except AssertionError, e:
            logger.warn("Failed to register route {}: {}".format(route, e))
        return f
    return wrapper
1202955
function processRouteContext (instance) {
  try {
    const route = instance.$route
    if (route) {
      const { path, query, params } = route
      const value = { path, query, params }
      if (route.fullPath) value.fullPath = route.fullPath
      if (route.hash) value.hash = route.hash
      if (route.name) value.name = route.name
      if (route.meta) value.meta = route.meta
      return [{
        key: '$route',
        value: {
          _custom: {
            type: 'router',
            abstract: true,
            value
          }
        }
      }]
    }
  } catch (e) {
    // Invalid $router
  }
  return []
}
650822
function loadRoutes() {
  try {
    var list = Crux.util.readDirectory(Component.appPath(this.config.path.routes), 'js'),
      self = this;
    if(list.length === 0) {
      return log.warn('Crux.server: component has no routes.');
    }
  } catch(e) {
    return;
  }

  list.forEach(function(routePath) {
    var routeObj = require(routePath);
    if(routeObj.skip === true) return;
    var httpRouteObj = self.createHttpRoute(routePath);
    if(!_.isFunction(routeObj)) {
      log.warn('Crux.server: Route %s does not export a function.', httpRouteObj.__rootPath);
      return;
    }
    routeObj(httpRouteObj);
    if(typeof self.routes[httpRouteObj.__namespace] !== 'undefined') {
      throw new Error("Route namespace " + httpRouteObj.__namespace + " previously registered.");
    }
    self.routes[httpRouteObj.__namespace] = httpRouteObj;
    routeCount++;
  });
  if(self.config.debug) {
    log.trace('Crux.server: %s route(s) loaded.', routeCount);
  }
}
471296
def register_app(app):
    "  "

    from .views import urls
    app.register_blueprint(urls)

    from .ext import admin
    admin.init_app(app)

    from flask_bootstrap import Bootstrap
    bootstrap = Bootstrap()
    bootstrap.init_app(app)

    from flask import render_template
    app.errorhandler(404)(lambda e: (render_template('core/404.html'), 404))
1230779
def add_view(self, path: str, handler: AbstractView,
                 **kwargs: Any) -> AbstractRoute:
        
        return self.add_route(hdrs.METH_ANY, path, handler, **kwargs)
489877
def find_route_by_view_name(self, view_name, name=None):
        
        if not view_name:
            return (None, None)

        if view_name == "static" or view_name.endswith(".static"):
            return self.routes_static_files.get(name, (None, None))

        return self.routes_names.get(view_name, (None, None))
435882
def url_for(self, action='view', **kwargs):
        
        app = current_app._get_current_object() if current_app else None
        if app is not None and action in self.url_for_endpoints.get(app, {}):
            endpoint, paramattrs, _external = self.url_for_endpoints[app][action]
        else:
            try:
                endpoint, paramattrs, _external = self.url_for_endpoints[None][action]
            except KeyError:
                raise BuildError(action, kwargs, 'GET')
        params = {}
        for param, attr in list(paramattrs.items()):
            if isinstance(attr, tuple):
                # attr is a tuple containing:
                # 1. ('parent', 'name') --> self.parent.name
                # 2. ('**entity', 'name') --> kwargs['entity'].name
                if attr[0].startswith('**'):
                    item = kwargs.pop(attr[0][2:])
                    attr = attr[1:]
                else:
                    item = self
                for subattr in attr:
                    item = getattr(item, subattr)
                params[param] = item
            elif callable(attr):
                params[param] = attr(self)
            else:
                params[param] = getattr(self, attr)
        if _external is not None:
            params['_external'] = _external
        params.update(kwargs)  # Let kwargs override params

        # url_for from flask
        return url_for(endpoint, **params)
692021
function applyRoutes(cmd, route, _app) {
    cmd = cmd.split(' ');
    var url = cmd[1] || cmd[0];
    var method = cmd.length < 2 ? 'get' : cmd[0];

    // Support regex expression
    var matches = /\((.*)\)/.exec(url);
    if(matches !== null && matches[1]) {
        url = new RegExp(matches[1]);
    }

    _app[method](url, function(req, res, next) {
        route.call({
            app: _app, req: req, res: res, next: next,
            //TODO:
            render: _app.get('render manager').list(res)
        }, req, res, next);
    });
}
1208225
function addAvailableRoutes(router) {
  return (req, res, next) => {
    const routes = router.stack
      .filter((r) => r.route && r.route.path) // grab only the defined routes (not api stuff)
      .map((r) => r.route.path); // pull out their paths

    res.locals.routes = routes; // and add them to the locals
    next();
  };
}
504754
function route() {
        configure()

        middlewares()

        for (let route of config.routes) {
            if (route.type === 'view')
                server[route.method](route.src, (req, res) => {
                    res.render(`${app.root}/views/${route.dest}.twig`, {})
                })

            if (route.type === 'controller') {
                let [path, method] = route.dest.split('::')

                let controller = function () {
                    if (!app.controllers)
                        return require(`${app.root}/controllers/${path.replace('.', '/')}`)(app)

                    if (path.split('.').length > 1)
                        return app.controllers[path.split('.')[0]][path.split('.')[1]]
                    else
                        return app.controllers[path]
                }()

                let func = wrapper(controller[method])
                if (!func)
                    app.drivers.logger.error('blockbase-express - wrapper', `Undefined function ${controller}${method}`)

                if (route.method === 'post' || route.method === 'put')
                    server[route.method](route.src, upload.any(), func)
                else
                    server[route.method](route.src, func)
            }
        }

        errors()
    }
357114
def bind(cls, app, *paths, methods=None, name=None, router=None, view=None):
        """"""
        cls.app = app
        if cls.app is not None:
            for _, m in inspect.getmembers(cls, predicate=inspect.isfunction):
                if not hasattr(m, ROUTE_PARAMS_ATTR):
                    continue
                paths_, methods_, name_ = getattr(m, ROUTE_PARAMS_ATTR)
                name_ = name_ or ("%s.%s" % (cls.name, m.__name__))
                delattr(m, ROUTE_PARAMS_ATTR)
                cls.app.register(*paths_, methods=methods_, name=name_, handler=cls)(m)

        @coroutine
        @functools.wraps(cls)
        def handler(request):
            return cls().dispatch(request, view=view)

        if not paths:
            paths = ["/%s" % cls.__name__]

        return routes_register(
            app, handler, *paths, methods=methods, router=router, name=name or cls.name)