From 7da14a1a65f2df35c36b1dcfdad1fafe830a70e7 Mon Sep 17 00:00:00 2001 From: Rolando Santamaria Maso Date: Sun, 6 Jan 2019 22:47:05 +0100 Subject: [PATCH] improving if method docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e23a84..f188bc8 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ app.use(middleware.iff([ ... ``` +In this example, only a `[POST|DELETE|PUT|PATCH] /tasks/:id` request will cause the middleware to be executed. ### Chaining You can optionally chain iff -> unless or vice-versa: ```js @@ -91,7 +92,7 @@ middleware.iff([ '/login', // if string is passed, the GET method is inferred { methods: ['DELETE', 'POST', '...'], - url: '/task/:id/*' + url: '/tasks/:id/*' } ]) ``` @@ -101,7 +102,7 @@ middleware.unless({ endpoints: [ '/login', // if string is passed, the GET method is inferred { methods: ['DELETE', 'POST', '...'], - url: '/task/:id/*' + url: '/tasks/:id/*' } ]}) ``` \ No newline at end of file