Getting an instance of a controller in the console

Problem

With the old router, it was possible to simply do App.router.get("homeController") to get to the controller instance, but this syntax has been deprecated in the new router.

Solution

Use App.__container__.lookup method.

// accessing HomeController instance
App.container.lookup("controller:home");
// accessing the router
App.container.lookup("router:main");