jfromaniello / express-unless

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

Added support for chaining and for describing each path as an object (containing path and method) #2

Closed mprinc closed 6 years ago

mprinc commented 10 years ago

Added support for chaining: .unless({path: ['/test', '/fobo']}) .unless({path: {p: '/nada', m: ['PUT', 'GET']}}) .unless({method: ['OPTIONS']});

Added support for path describing as object .unless({ path: [ '/milica', {p: '/nada', m: 'OPTIONS'}, {p: '/mile', m: ['DELETE', 'PUT']} ] });

jfromaniello commented 9 years ago

I like the chaining part, regarding describing path objects I already merged #10 , I like it explictly path as method instead of p and m.

I would like to merge the chaining part:

  1. remove the path describing object thing
  2. fix indentation

I am very sorry I took so long to reply.

sleungcy commented 7 years ago

👍 I would love to have this too!