get-routes
TypeScript icon, indicating that this package has built-in type declarations

2.1.6 • Public • Published

get-routes

get-routes gets all routes from an Express application.

Status

Category Status
Version npm
Dependencies David
Dev dependencies David
Build GitHub Actions
License GitHub

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

Dependents (8)

Package Sidebar

Install

npm i get-routes

Weekly Downloads

570

Version

2.1.6

License

MIT

Unpacked Size

17.2 kB

Total Files

15

Last publish

Collaborators

  • thenativeweb-admin
  • goloroden