Skip to content

Commit

Permalink
update documentation with multi-method info
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydaly committed May 16, 2018
1 parent 20f3164 commit bc3df07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ api.delete('/users', (req,res) => {
// do something
})
```
Additional methods are support by calling the `METHOD` method with three arguments. The first argument is the HTTP method, a *route*, and a function that accepts a `REQUEST` and a `RESPONSE` argument.
Additional methods are support by calling the `METHOD` method with three arguments. The first argument is the HTTP method (or array of methods), a *route*, and a function that accepts a `REQUEST` and a `RESPONSE` argument.

```javascript
api.METHOD('trace','/users', (req,res) => {
// do something
// do something on TRACE
})

api.METHOD(['post','put'],'/users', (req,res) => {
// do something on POST -or- PUT
})
```

Expand Down

0 comments on commit bc3df07

Please sign in to comment.