Adds onRoute method to AppRouter