Skip to content

Commit 7da14a1

Browse files
committed
improving if method docs
1 parent de41864 commit 7da14a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ app.use(middleware.iff([
4848

4949
...
5050
```
51+
In this example, only a `[POST|DELETE|PUT|PATCH] /tasks/:id` request will cause the middleware to be executed.
5152
### Chaining
5253
You can optionally chain iff -> unless or vice-versa:
5354
```js
@@ -91,7 +92,7 @@ middleware.iff([
9192
'/login', // if string is passed, the GET method is inferred
9293
{
9394
methods: ['DELETE', 'POST', '...'],
94-
url: '/task/:id/*'
95+
url: '/tasks/:id/*'
9596
}
9697
])
9798
```
@@ -101,7 +102,7 @@ middleware.unless({ endpoints: [
101102
'/login', // if string is passed, the GET method is inferred
102103
{
103104
methods: ['DELETE', 'POST', '...'],
104-
url: '/task/:id/*'
105+
url: '/tasks/:id/*'
105106
}
106107
]})
107108
```

0 commit comments

Comments
 (0)