I have the following code snippets within an application. I am looking for a way to apply "authController.isLoggedIn" to each instance of "router.get" without having to repeat it multiple times. Initially, I thought using router.use might be the solution, but upon further investigation, it does not seem to be the right approach. Any assistance on this matter would be highly appreciated. Thank you.
router.get('/tour/:slug', viewsController.getTour);
router.get('/login', authController.isLoggedIn, viewsController.getLoginForm);
router.get('/signup', authController.isLoggedIn, viewsController.getSignupForm);
router.get('/me', authController.protect, viewsController.getAccount);
router.get('/my-tours', authController.protect, viewsController.getMyTours);
router.get('/create', authController.protect, viewsController.createTour);