Permalink
Browse files

update documentation with multi-method info

  • Loading branch information...
jeremydaly committed May 16, 2018
1 parent 20f3164 commit bc3df07a4c241fc7013158b2c0b2173c5abf7292
Showing with 6 additions and 2 deletions.
  1. +6 −2 README.md
@@ -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
})
```

0 comments on commit bc3df07

Please sign in to comment.