7.1.1 • Published 5 months ago

express-list-endpoints v7.1.1

Weekly downloads
52,455
License
MIT
Repository
github
Last release
5 months ago

Express List Endpoints

!IMPORTANT This package only works for express 4.* versions. It's not compatible with express 5 yet.

GitHub Actions Workflow Status Codecov Coverage Report Code Climate Maintainability Report NPM Downloads NPM License

NPM Package Page

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

Examples of use

const express = require("express");
const expressListEndpoints = require("express-list-endpoints");

let app = express();

app
  .route("/")
  .all(function namedMiddleware(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
});

const endpoints = expressListEndpoints(app);

console.log(endpoints);

/* It omits 'all' handlers.
[
  {
    path: '/',
    methods: [ 'GET', 'POST' ],
    middlewares: [ 'namedMiddleware', 'anonymous', 'anonymous' ]
  },
  {
    path: '/about',
    methods: [ 'GET' ],
    middlewares: [ 'anonymous' ]
  }
]
*/
import express from "express";
import expressListEndpoints from "express-list-endpoints";

let app = express();

app
  .route("/")
  .all(function namedMiddleware(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
});

const endpoints = expressListEndpoints(app);

console.log(endpoints);

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.

Contributing to express-list-endpoints

Development

Running test:

npm test

License

Express List Endpoints is MIT licensed.

@simon-id/temp-testvuemanticatr-mf-gateway@infinitebrahmanuniverse/nolb-express-lmrkresz@everything-registry/sub-chunk-1634tatsy-httpswagger-doc-gen-clivue-express-mongo-boilerplatevue-cli-plugin-express@dotslibrary/dots-core@rbtdev/express-route-listispwms_extjson-serverless-libkessspecmaticsqreentintwork-modelstfg-documentationtravelchain-beta-uitravelsoft-util@ai-ecom/medusa-plugin-employee@aiaaio/astra-server@devotis/bouquet@digieappisgs/commonyao-node-server@finde/nofy@fraybabak/throttler@lambdacurry/express-oas-generator@lambdacurry/medusa-extender@micro-package/dynamo@micro-package/express@nexus-switchboard/nexus-extend@fabiansharp/express-oas-generator@elartedelcodigo/express-logger@mojaloop/callback-handler-simulator-svc@juniorcitizen/express-web-server@scout_apm/scout-apm@onebro/oba-express@onebro/oba-express-api@onebro/appmaster@nuworks/http-server@skyleague/event-horizon-cli@skyleague/event-horizon-dev@sgftech/medusa-extender@soapjs/soap-expressmsp.jsmerocmitsi_bot_libschoolmgtsysmiscserve-my-approute-listsafe-run-middlewaresend-http-axios-docnode-route-listernode-crud-kitnfw-coreplainwebsixth-nodesimple-request-trackerhubot-http-routesheroku-lwc-plugingraphql-express-exporterhydra-integrationlwc-build-utilsladrov-servermedusa-extender@xapokenkhsdiheuw/rest-dballbirds-apisalksawesome-express-apiazheda-utilsazheda-utils-v2backend-typescriptapi-express-exporterapidocifyapi-validate-docbanethqschoolmgtsysmisc@theobaidur/express-scaffold@theobaidur/typescript-express-api-scaffold@tdb/util.server@thxmike/express-root-controller@topgroup/diginext@twentyfourg-express-sdk/doc-generatorboiler-begonecor-base-servicecore.io-express-serverdefapicustom-payment-gatewayerocexpress-endpoint-aclexpress-endpoints-monitorexpress-implhandlerexpress-oas-generatorexpress-oas-generator-customizedexpress-oas-generator-v2express-generate-swaggerexpress-health-puppeteerexpress-help-middlewareexpress-insomnia-gendoc
7.1.1

5 months ago

7.1.0

1 year ago

7.0.0

1 year ago

6.0.0

4 years ago

5.0.0

5 years ago

4.0.1

6 years ago

4.0.0

7 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.3

8 years ago

2.0.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.0

9 years ago