get-routes
v2.1.6
Published
get-routes gets all routes from an Express application.
Downloads
4,106
Readme
get-routes
get-routes gets all routes from an Express application.
Status
| Category | Status | | ---------------- | ------------------------------------------------------------------------------------------------------- | | Version | | | Dependencies | | | Dev dependencies | | | Build | | | License | |
Installation
$ npm install get-routes
Quick start
First you need to add a reference to get-routes to your application:
const { getRoutes } = require('get-routes');
If you use TypeScript, use the following code instead:
import { getRoutes } from 'get-routes';
Then, call the getRoutes
function with an Express app to get a list of all registered routes:
const routes = getRoutes(app);
console.log(routes);
// => {
// get: [
// '/articles'
// ],
// post: [
// '/articles/:id'
// ],
// ...
// }
Running quality assurance
To run quality assurance for this module use roboter:
$ npx roboter