express-list-endpoints
Advanced tools
Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "express-list-endpoints", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "A express package to list all registered endoints and its verbs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Express List Endpoints | ||
Express endpoint parser to retrieve a list of the passed router with the set verbs. | ||
## Example of use | ||
```javascript | ||
router.route('/') | ||
.all(function(req, res) { | ||
// Handle request | ||
}) | ||
.get(function(req, res) { | ||
// Handle request | ||
}) | ||
.post(function(req, res) { | ||
// Handle request | ||
}); | ||
router.route('/about') | ||
.get(function(req, res) { | ||
// Handle request | ||
}); | ||
console.log(listEndpoints(router.stack)); | ||
/* It omits the 'all' verbs. | ||
[{ | ||
path: '/', | ||
methods: ['GET', 'POST'] | ||
}, | ||
{ | ||
path: '/about', | ||
methods: ['GET'] | ||
}] | ||
*/ | ||
``` | ||
## license | ||
MIT |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4045
6
1
40