Socket
Socket
Sign inDemoInstall

express-list-endpoints

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-list-endpoints

A express package to list all registered endoints and its verbs


Version published
Maintainers
1
Install size
70.8 kB
Created

Changelog

Source

v4.0.1 - 2019-05-06

Fixed

  • Add logic to avoid duplicate paths #40

Readme

Source

Express List Endpoints

Build Status codecov.io Maintainability

NPM

Express endpoint parser to retrieve a list of the passed router with the set verbs.

Example of use

const listEndpoints = require('express-list-endpoints')

let app = require('express')();

app.route('/')
  .all(function(req, res) {
    // Handle request
  })
  .get(function(req, res) {
    // Handle request
  })
  .post(function(req, res) {
    // Handle request
  });

app.route('/about')
  .get(function(req, res) {
    // Handle request
  });

console.log(listEndpoints(app));
/* It omits the 'all' verbs.
[{
    path: '/',
    methods: ['GET', 'POST']
  },
  {
    path: '/about',
    methods: ['GET']
}]
*/

Arguments

app - Express app or router instance

Your router instance (router) or your app instance (app).

Note: Pay attention that before call this script the router or app must have the endpoints registered due to detect them.

license

MIT

Keywords

FAQs

Last updated on 06 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc