List routes for Express Framework
npm i -D express-route-list
If you are using Typescript in project, read typescript setup
Export the app (regardless of where you are declaring it).
//app.js
module.exports = app;
Create a configuration file:
//route-list.js
const { configure } = require('express-route-list');
const app = require('./app');
configure(app, { showIndex: true, prefix: '' });
Create a script entry in package.json and run.
npm pkg set scripts.route-list="node route-list.js"
npm run route-list
This package provides a quick way to easily visualize your application's routes, with a minimal configuration.