Inject router into before method.