Setup the application and register basic routes
483163
public function init()
    {
        $this->config->set('http', [
            'request' => &$this->request,
            'response' => &$this->response,
        ]);

        Event::trigger('BeforeSystemInit', $this);

        if (!defined('IS_CONSOLE')) {
            $this->initHttpRequest();
        }

        Event::trigger('AfterSystemInit', $rtn);

        return $rtn;
    }
1077175
protected function setUp()
	{
		$this->register(array(
			'finding' => Finding::class,
			'route' => Route::class,
			'group' => Group::class
			));

        $this->addDefaultGroupHandler(new ClosureHandler());
        $this->addDefaultGroupHandler(new ArrayHandler());
//        $this->addDefaultGroupHandler(new PathHandler());

		return $this;
	}
978692
public function boot()
    {
        // Set response static instances
        $this->setResponseStaticInstances();

        // Configure the "Accept"-header parser
        DingoHttpRequest::setAcceptParser($this->app['Dingo\Api\Http\Parser\Accept']);

        // Rebind API router
        $this->app->rebinding('api.routes', function ($app, $routes) {
            $app['api.url']->setRouteCollections($routes);
        });

        // Initiate HTTP kernel
        $kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');

        /// Add middlewares to HTTP request
        $this->app[NodesHttpMiddlewareRequest::class]->mergeMiddlewares(
            $this->gatherAppMiddleware($kernel)
        );

        // Prepend request middleware
        $this->addRequestMiddlewareToBeginning($kernel);

        // Replace route dispatcher
        $this->app['events']->listen(DingoEventRequestWasMatched::class, function (DingoEventRequestWasMatched $event) {
            $this->replaceRouteDispatcher();
            $this->updateRouterBindings();
        });

        // Load project routes
        $this->loadRoutes();

        // Register namespace for API views
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'nodes.api');

        // Register publish groups
        $this->publishGroups();
    }
550500
public function boot()
    {
        $router = $this->app->make(Router::class);
        $path   = realpath(__DIR__ . '/../../');
        $this->addConfigComponent('antares/foundation', 'antares/foundation', $path . '/resources/config');
        $this->addLanguageComponent('antares/foundation', 'antares/foundation', $path . '/resources/lang');
        $this->assignAreaTemplate();


        $this->appendWidgetsDefaultConfig();
        if (!$this->app->routesAreCached()) {
            require "{$path}/src/routes.php";
        }

        $router->aliasMiddleware('antares.forms', FormMiddleware::class);
        $router->aliasMiddleware('antares.ui-components', UIComponentsMiddleware::class);
        $this->runtime();


        $this->app->make('events')->fire('antares.ready');
        $this->app->make('events')->fire(new AntaresReady());
        $this->app->make('view')->composer(['antares/foundation::account.index', 'antares/logger::admin.devices.*'], \Antares\Users\Http\Handlers\AccountPlaceholder::class);

        if ($this->app->bound('antares.watchdog')) {
            $this->app->make('events')->subscribe(AfterExtensionOperation::class);
        }

        $this->app->make('view')->composer('antares/foundation::breadcrumbs.bootstrap3', function($view) {
            view()->share('breadcrumbs_data', array_get($view->getData(), 'breadcrumbs', []));
        });

        $this->app->make('events')->listen(LoadServiceProviders::class, function() {
            $widgets = $this->app->make('antares.ui-components.finder')->detectRoutes();

            $widgets->each(function($widget) {
                if (class_exists($widget)) {
                    $widget::routes();
                }
            });
        });
        $this->app->bind('languages', function($app) {
            return new Languages($app);
        });
    }
103041
public void register() {
        routes.values().forEach(route -> logAddRoute(log, route));
        hooks.values().stream().flatMap(Collection::stream).forEach(route -> logAddRoute(log, route));

        Stream.of(routes.values(), hooks.values().stream().findAny().orElse(new ArrayList<>()))
                .flatMap(Collection::stream).forEach(this::registerRoute);

        regexMapping.register();

        webSockets.keySet().forEach(path -> logWebSocket(log, path));
    }
1261471
def bind(cls, app, *paths, methods=None, name=None, view=None):
        """"""
        # Register self in admin
        if view is None:
            app.ps.admin.register(cls)
            if not paths:
                paths = ('%s/%s' % (app.ps.admin.cfg.prefix, name or cls.name),)
            cls.url = paths[0]
        return super(AdminHandler, cls).bind(app, *paths, methods=methods, name=name, view=view)
183592
protected static function registerRoutes()
    {
        parent::routes(function ($router) {
            /* @var \Illuminate\Routing\Router $router */
            $router->get('logs', 'Encore\Admin\LogViewer\LogController@index')->name('log-viewer-index');
            $router->get('logs/{file}', 'Encore\Admin\LogViewer\LogController@index')->name('log-viewer-file');
            $router->get('logs/{file}/tail', 'Encore\Admin\LogViewer\LogController@tail')->name('log-viewer-tail');
        });
    }
510567
protected static function registerRoutes()
    {
        parent::routes(function ($router) {
            /* @var \Illuminate\Routing\Router $router */
            $router->get('backup', 'Encore\Admin\Backup\BackupController@index')->name('backup-list');
            $router->get('backup/download', 'Encore\Admin\Backup\BackupController@download')->name('backup-download');
            $router->post('backup/run', 'Encore\Admin\Backup\BackupController@run')->name('backup-run');
            $router->delete('backup/delete', 'Encore\Admin\Backup\BackupController@delete')->name('backup-delete');
        });
    }
767853
public function boot()
    {
        // require routes
        if (!$this->app->routesAreCached()) {
            $this->app['router']->group(['middleware' => 'web', 'namespace' => 'Chronos\Content\Http\Controllers', 'prefix' => 'admin'], function () {
                require __DIR__ . '/routes/web.php';
            });
            $this->app['router']->group(['middleware' => App::environment('local', 'staging') ? 'api' : ['auth:api', 'bindings'], 'namespace' => 'Chronos\Content\Api\Controllers', 'prefix' => 'api'], function () {
                require __DIR__ . '/routes/api.php';
            });
        }

        // publish config
        $this->publishes([
            __DIR__ . '/config/content.php' => config_path('content.php'),
        ], 'config');
        $this->publishes([
            __DIR__ . '/config/languages.php' => config_path('languages.php'),
        ], 'config');

        // load migrations
        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');

        // load translations
        $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'chronos.content');

        // load views
        $this->loadViewsFrom(__DIR__ . '/resources/views', 'chronos');

        // publish views so they can be overridden
        $this->publishes([
            __DIR__ . '/resources/views' => resource_path('views/vendor/chronos'),
        ], 'views');

        // publish assets
        $this->publishes([
            __DIR__ . '/assets/' => public_path('chronos'),
        ], 'public');

        // register menu
        $this->updateMenu();
    }
906109
private function initRouter()
    {
        $this->di->mapService('core.router', '\Core\Router\Router');

        $this->router = $this->di->get('core.router');
        $this->router->setBaseUrl(BASEURL);
        $this->router->setParametersToTarget([
            'app',
            'controller',
            'action'
        ]);
        $this->router->addMatchTypes([
            'mvc' => '[A-Za-z0-9_]++'
        ]);

        // Generic routes
        $routes = [
            'index' => [
                'route' => '/[mvc:app]/[mvc:controller]',
                'target' => [
                    'action' => 'index'
                ]
            ],
            'action' => [
                'route' => '/[mvc:app]/[mvc:controller]/[mvc:action]'
            ],
            'id' => [
                'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]'
            ],
            'child' => [
                'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]/of/[i:id_parent]'
            ]
        ];

        foreach ($routes as $name => $route) {
            $this->router->map($route['method'] ?? 'GET|POST', $route['route'], $route['target'] ?? [], 'generic.' . $name);
        }
    }
418849
public function setupRoutes()
    {
        $routesFile = app_path().'/Http/routes.php';

        $currentRoutes = file_get_contents($routesFile);

        if(strstr($currentRoutes,"ENTRANCE ROUTES") == false){
            $token = '';
            $routes = "\n //ENTRANCE ROUTES \n//Prefix for the paths below.
Route::group(['prefix' => config('entrance.prefix')], function() {

    Route::get('login', ['as' => 'login.index', 'uses' => function () {
        return view('entrance::pages.login');
    }]);

    // POST - Logs user in
    Route::post('login', ['as' => 'postLogin', 'uses' => config('entrance.classes.entrance_controller').'@doLogin']);
    // GET - Logs user out
    Route::get('logout', ['as' => 'logout.index', 'uses' => config('entrance.classes.entrance_controller').'@doLogout']);

    // GET- Show succes page
    Route::get('resetSuccess', ['as' => 'reset.success', 'uses' => config('entrance.classes.entrance_controller').'@showResetSuccess']);
    Route::get('success', ['as' => 'success', 'uses' => function () {
        return view('entrance::pages.success');
    }]);

    // GET - Show the send reset e-mail page/form
    Route::get('reset-password', ['as' => 'reset.password', 'uses' => function () {
        return view('entrance::pages.resetpassword');
    }]);

    // POST - Send reset e-mail
    Route::post('sendReset', ['as' => 'sendReset', 'uses' => config('entrance.classes.entrance_controller').'@sendReset']);

    // GET - Show reset page/form
    Route::get('reset/{token}', ['as' => 'password_reset', 'middleware' => 'checktoken', 'uses' => function (\$token) {
        return view('entrance::pages.reset')->with(['token' => \$token]);
    }]);

    // POST - Reset Password
    Route::post('doReset', ['as' => 'doReset', 'uses' => config('entrance.classes.entrance_controller').'@doReset']);

    // GET - Show register form
    Route::get('register', ['as' => 'register', 'uses' => function() {
        return view('entrance::pages.register');
    }]);

    // POST - Register User
    Route::post('doRegister', ['as' => 'postRegister', 'uses' => config('entrance.classes.entrance_controller').'@doRegister']);

    //Authentication group - Check if user is logged in
    Route::group(['middleware' => 'checklogin'], function() {

    });
});
        \n";


        file_put_contents($routesFile, $routes, FILE_APPEND | LOCK_EX);
        }

    }
659580
def register_app(app):
    "  "

    from .views import users
    app.register_blueprint(users)

    from .oauth import config_oauth
    config_oauth(app)
372751
public function setup()
    {
        if (!$this->_checkRequestType('jsonapi')) {
            return;
        }

        $appClass = Configure::read('App.namespace') . '\Application';

        // If `App\Application` class exists it means Cake 3.3's PSR7 middleware
        // implementation is used and it's too late to register new error handler.
        if (!class_exists($appClass, false)) {
            $this->registerExceptionHandler();
        }
    }
417669
def register_route(self, app):
        """"""
        if "url" not in self.params["options"]:
            raise Exception("Component does not have a URL property")

        if not hasattr(self.route_func, "__call__"):
            raise Exception("No app route function supplied")

        app.add_url_rule(self.params["options"]["url"],
            self.params["options"]["url"],
            self.route_func)
15044
private function setupApp()
    {
        if ($this->session instanceof \SessionHandlerInterface)
        {
            $serverStack = new SessionProvider(
                new WampServer(
                    $this->getContainer()->get("jdare_clank.clank_app")
                ),
                $this->session
            );

        }else{
            $serverStack = new WampServer(
                $this->getContainer()->get("jdare_clank.clank_app")
            );
        }


        $this->app = new WsServer(
            $serverStack
        );
    }
690390
private function registerModuleRoutes()
    {
        $this->app->singleton('typicms.routes', function (Application $app) {
            try {
                return $app->make('Pages')->with('files')->getForRoutes();
            } catch (Exception $e) {
                return [];
            }
        });
    }
1067366
public static function registerRoutes()
    {
        parent::routes(function ($router) {
            /* @var \Illuminate\Routing\Router $router */
            $router->get('helpers/terminal/database', 'Encore\Admin\Helpers\Controllers\TerminalController@database');
            $router->post('helpers/terminal/database', 'Encore\Admin\Helpers\Controllers\TerminalController@runDatabase');
            $router->get('helpers/terminal/artisan', 'Encore\Admin\Helpers\Controllers\TerminalController@artisan');
            $router->post('helpers/terminal/artisan', 'Encore\Admin\Helpers\Controllers\TerminalController@runArtisan');
            $router->get('helpers/scaffold', 'Encore\Admin\Helpers\Controllers\ScaffoldController@index');
            $router->post('helpers/scaffold', 'Encore\Admin\Helpers\Controllers\ScaffoldController@store');
            $router->get('helpers/routes', 'Encore\Admin\Helpers\Controllers\RouteController@index');
        });
    }