Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram-dc committed Jan 26, 2024
1 parent 906cb52 commit edab67a
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Express endpoint parser to retrieve a list of the passed router with the set ver

## Example of use

Warning: In contrast to the original package, this package does not merge the endpoints which are initialized with the same path.
Warning: In contrast to the original package, this package does not merge the endpoints which are initialized in the same chain.

```javascript
const listEndpoints = require('express-list-endpoints-2')
Expand Down Expand Up @@ -40,21 +40,25 @@ console.log(listEndpoints(app))

/* It omits the 'all' verbs.
[
{
path: '/',
methods: ['GET', 'POST'],
middlewares: [[Function namedMiddleware], [Function anonymous], [Function anonymous]],
},
{
path: '/',
methods: ['POST'],
middlewares: [[Function namedMiddleware2], [Function anonymous]],
},
{
path: '/about',
methods: ['GET'],
middlewares: [[Function anonymous]],
},
{
path: '/',
methods: [ 'GET', 'POST' ],
middlewares: [
[Function: namedMiddleware],
[Function (anonymous)],
[Function (anonymous)]
]
},
{
path: '/',
methods: [ 'POST' ],
middlewares: [ [Function: namedMiddleware2], [Function (anonymous)] ]
},
{
path: '/about',
methods: [ 'GET' ],
middlewares: [ [Function (anonymous)] ]
}
]
*/
```
Expand Down

0 comments on commit edab67a

Please sign in to comment.