unless(middleware, options)
Skip middleware when it fulfill the conditions
expectThat(middleware, options)
Skip middleware when it does not fulfill the conditions
- middleware Middleware to skip
- options Conditions to test
- [paths] Can be an array of string, an array of object or a string
- [extensions] Can be a string or an array of string
Allow to filter on originalUrl and methods
- path Can be an object or a string
- urls Can be a string or an array of string
- [methods] Can be a string or an array of string
{ paths: '/foo' }
{ paths: ['/foo', '/bar'] }
{ paths: [{ urls: '/foo', method: 'GET' }] }
{ paths: [{ urls: ['/foo', '/bar'], method: ['GET', 'PUT'] }] }Allow to filter on the path end extension (with or without the dot)
{ extensions: '*' }
{ extensions: 'jpg' }
{ extensions: '.jpg' }
{ extensions: ['.jpg', 'css'] }