Answers for "express middleware pass parameter"

1

express middleware pass parameter

function HasRole(role) {
  return function(req, res, next) {
    if (role !== req.user.role) res.redirect(...);
    else next();
  }
}
Posted by: Guest on June-17-2020

Code answers related to "express middleware pass parameter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language