jfromaniello / express-unless

Conditionally add a middleware to express with some common patterns
MIT License
178 stars 27 forks source link

Can't get it working #25

Closed george-norris-salesforce closed 5 years ago

george-norris-salesforce commented 5 years ago
handleExpiredTokens.unless({
  path: [{
    url: '/foo',
    methods: ['POST']
  }]
});
function handleExpiredTokens(err, req, res, next) {
 // stuff
}

handleExpiredTokens.unless = unless;

module.exports = handleExpiredTokens;

handleExpiredTokens runs on every request including POST /foo