Skip to content

Commit

Permalink
improving if method docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkyberneees committed Jan 6, 2019
1 parent de41864 commit 7da14a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/*'
}
])
```
Expand All @@ -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/*'
}
]})
```

0 comments on commit 7da14a1

Please sign in to comment.