How to guard route by user role ?
I'm trying to guard a route based on the user's role in my Express.js app, but I'm unsure how to implement this properly. I know I need to check the user's role before allowing access to certain routes, but I'm not clear on how to set up role-based access control (RBAC) or which middleware functions to use for this purpose. Could someone explain the best way to guard routes by user role in Express.js?