A simple utility that lists out all registered routes in your express application.
npm install -D express-routes-catalogue
const express = require("express");
const routeList = require("express-routes-catalogue");
const app = express();
app.get("/", (req, res) => {
res.send("Hello World ...");
});
// For terminal output
if (process.env.NODE_ENV === "development") {
routeList.terminal(app);
}
...
const express = require("express");
const routeList = require("express-routes-catalogue");
const app = express();
app.get("/", (req, res) => {
res.send("Hello World ...");
});
// For web output
if (process.env.NODE_ENV === "development") {
routeList.web(
app,
"/route-list"
);
}
...
Now Navigate to your-application/route-list, you can see full routes list.
- Fork it!
- Create your feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -am 'Some commit message'
- Push to the branch:
git push origin feature-name
- Submit a pull request 😉😉
MIT © Vijay