How to add a default controller to the  route? Is it possible to add a default controller to the '&lt;front&gt;' route? There's no default controller defined in system.routing.yml.

I'm trying to get a handle on it by using the following code: 

&lt;?php

namespace Drupal\mymodule\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    // Get front page and set controller.
    if ($route = $collection-&gt;get('&lt;front&gt;')) {
      $route-&gt;setDefault('_controller', '\Drupal\mymodule\Controller\MyModuleController::MyModuleMethod');
    }
  }

}


But it doesn't seem to do anything. However this code works when replacing '&lt;front&gt;' with another route like help.main. Why is that? Do I have to add the controller instead of setting it?
(D8)
&lt;front&gt; is not really a route that can be resolved for an incoming request, it's just a helper for building a URL.

It works in the opposite way, you create a controller at whatever path you want, and then you set the frontpage to that path on the system information page aka in the system.site configuration object.