I have NodeJs App in which i am using a middleware for authorization which is as follows:-
app.use('/api', authorizeMiddleWare, routes);
and there is routes which consists of all the routes which is suppose as follows:-
router.use('/route1', route1);
router.use('/route2', route2);
and these routes also have sub routes
router.route('/:id/user').get(controller.getUser)
I want to exclude only this Route from authorization middleware:-
GET /api/route1/id/user
Could anyone help me with this?