Dependency injection for router.