Resources::route
180811
public function route()
    {
        $segments = server_request()->getUri()->getSegments()->getParts();
        array_shift($segments);

        $download = false;
        if (false !== ($key = array_search('download', $segments))) {
            $download = true;
            unset($segments[ $key ]);
            $segments = array_values($segments);
        }

        if (count($segments)) {
            $filePath = $this->directoryPath . implode(DIRECTORY_SEPARATOR, $segments);
            if (is_file($filePath)) {
                if ($download) {
                    $downloader = new Downloader($filePath);
                    $downloader
                        ->speedLimit($this->speedLimit)
                        ->resumeable($this->resumeable)
                        ->download();
                } else {
                    $fileInfo = new SplFileInfo($filePath);
                    header('Content-Disposition: filename=' . $fileInfo->getFilename());
                    header('Content-Transfer-Encoding: binary');
                    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
                    header('Content-Type: ' . $fileInfo->getMime());
                    echo @readfile($filePath);
                    exit(EXIT_SUCCESS);
                }
            } else {
                redirect_url('error/404');
            }
        } else {
            redirect_url('error/403');
        }
    }
480028
@GET
    public List<String> getRoutes() {
        List<Resource> resourceList = resourceContext.getResourceModel().getResources();
        List<String> routeList = Lists.newArrayList();
        for (Resource resource : resourceList) {
            String path = resource.getPath().startsWith("/") ? "" : "/" + resource.getPath();
            if (resource.getAllMethods().size() > 0) {
                routeList.add(path);
            }
            routeList.addAll(
                    resource.getChildResources()
                            .stream()
                            .map(res -> path + (res.getPath().startsWith("/") ? "" : "/") + res.getPath())
                            .collect(Collectors.toList())
            );
        }
        return routeList;
    }
731402
public function Index() {
      $this->Permission('Garden.Settings.Manage');
      $this->AddSideMenu('dashboard/routes');
      $this->AddJsFile('routes.js');
      $this->Title(T('Routes'));
      
      $this->MyRoutes = Gdn::Router()->Routes;
      $this->Render();
   }
532984
function routePath (route) {
  if (!route) return ''
  return route.path || (route.regexp && route.regexp.source) || ''
}
1085919
def get_route(self, name):
        '''
        '''
        for route in self.routes:
            if route.name == name:
                return route
        for child in self.routes:
            route = child.get_route(name)
            if route:
                return route
939735
private function route() : void
    {
        // Parse route
        $parsed = $this->parseRoute();

        // Run error controller when no route matched
        if (!$parsed && isset($this->error_controller)) {
            call_user_func($this->error_controller);
        }
    }
1287886
def routes_register(app, handler, *paths, methods=None, router=None, name=None):
    """"""
    if router is None:
        router = app.router

    handler = to_coroutine(handler)

    resources = []

    for path in paths:

        # Register any exception to app
        if isinstance(path, type) and issubclass(path, BaseException):
            app._error_handlers[path] = handler
            continue

        # Ensure that names are unique
        name = str(name or '')
        rname, rnum = name, 2
        while rname in router:
            rname = "%s%d" % (name, rnum)
            rnum += 1

        path = parse(path)
        if isinstance(path, RETYPE):
            resource = RawReResource(path, name=rname)
            router.register_resource(resource)

        else:
            resource = router.add_resource(path, name=rname)

        for method in methods or [METH_ANY]:
            method = method.upper()
            resource.add_route(method, handler)

        resources.append(resource)

    return resources
749938
protected function mapAdminRoutes()
    {
        $this->prefix($this->config()->get('arcanesoft.media.route.prefix', 'media'))
             ->name('media.')
             ->group(function () {
                 Routes\Admin\MediaRoutes::register();
                 Routes\Admin\ApiRoutes::register();
             });
    }
1272731
public function routes()
    {
        Route::get('countries/{id}', function ($id) {
            $request = request();
            return CountryStore::country($id, $request);
        })->name('country');

        Route::get('countries', function () {
            $request = request();
            return CountryStore::countries($request);
        })->name('countries');

        Route::get('administrative_areas/{id}', function ($id) {
            $request = request();
            return CountryStore::administrativeArea($id, $request);
        })->name('administrative_area');

        Route::get('cities/{city_id}', function ($city_id) {
                $request = request();
                return CountryStore::city($city_id, $request);
        })->name('city');
    }
426378
def _route(self, attr, args, kwargs, **fkwargs):
        

        key = get_key(args, kwargs)

        found = self._hash.get_node(key)

        if not found and len(self._down_connections) > 0:
            raise self.HostListExhausted()

        return [i for i, h in self.cluster.hosts.iteritems()
                if h.identifier == found]
127416
def handle_json_GET_routes(self, params):
    """"""
    schedule = self.server.schedule
    result = []
    for r in schedule.GetRouteList():
      result.append( (r.route_id, r.route_short_name, r.route_long_name) )
    result.sort(key = lambda x: x[1:3])
    return result
1125376
def url_for(resource, params = {}, options = {})
      Xhive.railtie_routes_url_helpers.send("#{resource}_url", params, options.merge(default_url_options))
    end
140442
function Router() {
  var self = this;
  this._routes = [];
  this.middleware = function(page, next) {
    self._dispatch(page, next);
  };
}
355833
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {

            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('dashboard', 'AdminController@dashboard')->name('dashboard')->middleware('can:see-dashboard');
                $router->get('', 'AdminController@index')->middleware('can:see-dashboard');
            });
        });
    }
1273996
def _route(self):
        '''  '''
        self._app.route('/',
                        method='GET',
                        callback=self._get_logger_list)
        self._app.route('/stats',
                        method='GET',
                        callback=self._fetch_handler_stats)
        self._app.route('/<name>/start',
                        method='POST',
                        callback=self._add_logger_by_name)
        self._app.route('/<name>/stop',
                        method='DELETE',
                        callback=self._stop_logger_by_name)
        self._app.route('/<name>/config',
                        method='GET',
                        callback=self._get_logger_conf)
        self._app.route('/<name>/rotate',
                        method='POST',
                        callback=self._rotate_capturer_log)
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()
    }
123416
def route(self, path):
        # type: (str)->Tuple[Any, Callable]
        
        logging.getLogger(__name__).debug("Routing path '%s'.", path)

        cls = None
        for strategy in self._strategies:
            if strategy.can_route(path):
                cls = strategy.route(path)
                break

        if cls is None:
            raise RoutingError(path)

        return self._create_result(cls)