Express List Endpoints
[!IMPORTANT]
This package only works for express 4.* versions. It's not compatible with express 5 yet.
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) {
})
.get(function (req, res) {
})
.post(function (req, res) {
});
app.route("/about").get(function (req, res) {
});
const endpoints = expressListEndpoints(app);
console.log(endpoints);
import express from "express";
import expressListEndpoints from "express-list-endpoints";
let app = express();
app
.route("/")
.all(function namedMiddleware(req, res) {
})
.get(function (req, res) {
})
.post(function (req, res) {
});
app.route("/about").get(function (req, res) {
});
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.