gets custom routes from config
776408
private function setCustomRoutesFromConfig()
    {
        // we be checkin' our instruction fer configgered routes
        $configgeration = Registry::ahoy()->get('routes');

        // stick some voodoo pins in the map
        foreach ($configgeration as $route => $options) {
            // add the route t' the map
            $this->routes[] = new Route($route, $options);
        }
    }
694811
private function initAPIRoutes()
    {
        $path = Config::get('generator.path_routes', app_path('Http/routes.php'));

        $fileHelper = new FileHelper();
        $routeContents = $fileHelper->getFileContents($path);

        $useDingo = Config::get('generator.use_dingo_api', false);

        if ($useDingo) {
            $template = 'dingo_api_routes_group';
        } else {
            $template = 'api_routes_group';
        }

        $templateHelper = new TemplatesHelper();
        $templateData = $templateHelper->getTemplate($template, 'routes');

        $templateData = $this->fillTemplate($templateData);

        $fileHelper->writeFile($path, $routeContents."\n\n".$templateData);
        $this->comment("\nAPI group added to routes.php");
    }
523575
function (config) {
        if (typeof config !== 'object') {
            throw new Error('Invalid Route Config');
        }
        if (typeof config.route !== 'string') {
            var name_1 = config.name || '(no name)';
            throw new Error('Invalid Route Config for "' + name_1 + '": You must specify a "route:" pattern.');
        }
        if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) {
            throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".');
        }
    }
1016468
def _url(self):
        """"""
        if self.ID_NAME not in self.route.keys() and "id" in self.data.keys():
            self.route[self.ID_NAME] = self.data["id"]
        return self.config.BASE + self.PATH.format(**self.route)
1121056
public static function routes()
  {
    Route::group(['namespace' => 'Auth'], function () {

      Route::group(['middleware' => ['guest']], function () {

        Route::get('login', 'LoginController@showLoginPage')->name('showLogin');
        Route::post('login', 'LoginController@login')->name('login');

        Route::get('login/email', 'LoginController@showMagicLinkPage')->name('showMagicLink');
        Route::post('login/email', 'LoginController@loginWithEmail')->name('loginWithEmail');
        Route::get('login/callback/email/', 'LoginController@loginEmailCallback')->name('loginCallback');

        Route::get('register', 'RegisterController@showRegistrationPage')->name('showRegistration');
        Route::post('register', 'RegisterController@register')->name('register');

        Route::get('password/forgot', 'ForgotPasswordController@showForgotPasswordPage')->name('showForgotPassword');
        Route::post('password/forgot', 'ForgotPasswordController@forgot')->name('forgot');

        Route::get('password/reset', 'ForgotPasswordController@showResetPasswordPage')->name('showResetPassword');
        Route::post('password/reset', 'ForgotPasswordController@resetPassword')->name('resetPassword');

      });

      Route::get('logout', 'LoginController@logout')->name('logout')->middleware('private', 'auth');
      Route::get('account/verify', 'RegisterController@verifyEmail')->name('verify');

    });
  }
731948
function adaptForRouter(val, key) {
  key = key.split(/\s+/);
  if (typeof val === 'string' || typeof val === 'function' || Array.isArray(val)) {
    val = {
      path: key[0],
      method: key[1],
      controller: val
    };
  } else if (typeof val === 'object') {
    if (!val.path) {
      val.path = key[0];
    }
    if (!val.method) {
      val.method = key[1];
    }
  } else {
    throw new Error(`Problem with route "${key}"`);
  }
  return val;
}
830923
public function getConfigParams()
    {
        $response = array_merge(Config::$required, Config::$optional);
        $domains = Router::getInstance()->getDomains();
        foreach ($domains as $domain => $routes) {
            $pDomain = str_replace('@', '', $domain);
            $pDomain = str_replace('/', '', $pDomain);
            $response[] = strtolower($pDomain) . '.api.secret';
        }
        return $this->json($response);
    }
987066
function getRoutes(appName) {
    if (appRouteCache[appName]) { return appRouteCache[appName]; }      // if route info already cached, return that

    var appConfig = appConfigs[appName];
    var routes = [];

    _.each(appConfig.routes, function (route) {                 // loop through routes in the .app file
        _.each(route.urls, function (urlPattern) {              // create separate routeInfo for each URL

            var urlRegex = convertUrlPatternToRegex(urlPattern);
            routes.push(_.extend({
                urlPattern:     urlPattern,
                urlRegex:       urlRegex,
                layout:         route.layout || appConfig.defaultLayout || appName,
                wrapper:        route.wrapper || appConfig.defaultWrapper || 'server.page',
                strip:          route.strip || appConfig.defaultStrip || true,
                contentType:    route.contentType,
                data:           route.data || appConfig.data,
                serverOnly:     appConfig.serverOnly
            }, route));
        });
    });

    appRouteCache[appName] = routes;
    return routes;
}
705681
function initRoutes (config, route) {
    // create express router for route
    route.router = express.Router({
        caseSensitive: true,
        strict: true,
    })
    // initialize routes depth first so that explicit nested paths come
    // before wildcard paths and are handled correctly by express router
    _.each(route.routes, (subRoute, path) => {
        // get router for sub route
        var router = initRoutes(config, subRoute)
        // bind route for path
        route.router.use('/'+path+'/', router)
    })
    // clear model if no properties are set
    if (_.keys(route.model).length === 0) {
        route.model = undefined
    }
    // clear controller if no properties are set
    if (_.keys(route.controller).length === 0) {
        route.controller = undefined
    }
    // instantiate ImmutableCoreModel
    if (defined(route.model)) {
        route.model = new ImmutableCoreModel(route.model)
        // add model to app register
        config.models[route.model.name] = route.model
    }
    // if model is not set use model for this node
    if (defined(route.controller) && !defined(route.controller.model)) {
        route.controller.model = route.model
    }
    // instantiate ImmutableCoreController - this will create default controllers
    // for model
    var controller = route.controller = new ImmutableCoreController(route.controller)
    // get all templates then remove those that have controllers
    var bareTemplates = _.cloneDeep(route.templates)
    // iterate over paths
    _.each(controller.paths, path => {
        // iterate over http methods for path
        _.each(path, methods => {
            // iterate over handlers for different roles
            _.each(methods, spec => {
                // role can be specific or default to all
                var role = spec.role || 'all'
                // template can be specified or take from method name
                var template = spec.template || spec.methodName
                // template name exists locally
                if (defined(route.templates[template])) {
                    // if there is a template for the controllers role then remove
                    // it from the list of unused templates
                    if (defined(bareTemplates[template].role[role])) {
                        delete bareTemplates[template].role[role]
                    }
                    // otherwise if there is a template for all roles then assign
                    // it to this controller so that another controller for the
                    // all role will not be created to serve the template
                    else if (defined(bareTemplates[template].role['all'])) {
                        delete bareTemplates[template].role['all']
                    }
                }
            })
        })
    })
    // set to true if any controllers addded
    var added = false
    // create paths for any templates without controllers
    _.each(bareTemplates, (template, templateName) => {
        // iterate over any templates for roles that have not been used
        _.each(template.role, (templatePath, role) => {
            // get path from template name with index becoming /
            var path = templateName === 'index' ? '/' : '/'+templateName
            // create entry for path in controller if not yet defined
            if (!controller.paths[path]) {
                controller.paths[path] = {}
            }
            // create entry for method if not yet defined
            if (!controller.paths[path]['get']) {
                controller.paths[path]['get'] = []
            }
            // add spec for template to controller
            controller.paths[path]['get'].push({
                role: role,
                template: templatePath,
            })
        })
    })
    // if controllers were added then need to reorder controllers
    if (added) {
        controller.orderControllers()
    }
    // get list of path names
    var pathNames = _.keys(controller.paths)
    // sort path names so that static names go above onces with placeholders
    var sortedPathNames = pathNames.sort(sortPlaceholdersLower)
    // create routes for controller paths
    _.each(sortedPathNames, path => {
        var methods = controller.paths[path]
        // add route for each method
        _.each(methods, (spec, method) => {
            // create ImmutableAppPresenter instance
            var presenter = new ImmutableAppPresenter({
                config: config,
                method: method,
                module: module,
                path: path,
                route: route,
                spec: spec,
            })
            // middleware for route
            var routeMiddleware = []
            // iterate over spec(s) for different roles
            _.each(spec, roleSpec => {
                // if spec has middleware add to router
                _.each(roleSpec.middleware, middleware => {
                    routeMiddleware.push(middleware)
                })
            })
            // add presenter as final middleware
            routeMiddleware.push(presenter)
            // add path to router with method
            route.router[method](path, routeMiddleware)
        })
    })
    // return router so it can be bound to parent
    return route.router
}
591418
def get_routes(iface):
    '''
    
    '''
    path = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route-{0}'.format(iface))
    path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route6-{0}'.format(iface))
    routes = _read_file(path)
    routes.extend(_read_file(path6))
    return routes
311727
function getTemplatesList(customPath = null) {
  const predefined = getDirectories(DEFAULT_PATH_TEMPLATES).reduce(createListOfDirectories, {})
  try {
    const custom = customPath ? getDirectories(customPath).reduce(createListOfDirectories, {}) : []

    return { ...predefined, ...custom }
  } catch (error) {
    Logger.warn('The custom templates path that you supply is unreachable')
    Logger.warn('falling back to defaults templates')
    return predefined
  }
}
991966
public static function getRoutes($context = null)
    {
        if($context == null)
            $context = getenv('ERDIKO_CONTEXT');
        $file = ERDIKO_APP."/config/{$context}/routes.json";
        $applicationConfig = static::getConfigFile($file);
        
        return $applicationConfig['routes'];
    }
934665
def make_config_get(conf_path):
    
    project_root = _get_project_root_from_conf_path(conf_path)
    config = load_config_in_dir(project_root)
    return partial(config_get, config)
1148409
def route_from_configuration
      res = AttachmentInput.configuration.route
      res.respond_to?(:call) ? res.call : res
    end
493026
def get_urls(self):
        """"""
        from django.conf.urls import patterns, url
        from views import DashboardWelcomeView

        urls = super(AdminMixin, self).get_urls()
        del urls[0]
        custom_url = patterns(
            '',
            url(r'^$', self.admin_view(DashboardWelcomeView.as_view()), name="index")
        )

        return custom_url + urls
288521
function getDefaultRoute() {
  try {
    const fileContents = fs.readFileSync('/proc/net/route', 'utf8'); // eslint-disable-line no-sync
    const routes = fileContents.split('\n');
    for (const routeIdx in routes) {
      const fields = routes[routeIdx].trim().split('\t');
      if (fields[1] === '00000000') {
        const address = fields[2];
        // Convert to little endian by splitting every 2 digits and reversing that list
        const littleEndianAddress = address.match(/.{2}/g).reverse().join('');
        return intToIP(parseInt(littleEndianAddress, 16));
      }
    }
  } catch (e) {
    console.error('Could not get default route from /proc/net/route');
  }
  return null;
}
701658
function parseStaticRoutes(config) {
  Object.keys(config).map((key) => {
    StaticRoutes.push({
      method: 'get',
      route: key,
      controller: config[key].target,
      action: '*',
      options: config[key].options,
      generated: true,
      debug: {
        controller: config[key].target,
        action: '*'
      }
    });
  });
}