In my backend app I am using express-promise-router to manage my routes.
For example:
const express = require( 'express' );
const router = require( 'express-promise-router' )();
let app = express();
app.use( router.get( "/hc" , ( req,res,next )=> res.status( 200 ).send( "healthy!" ) ) );
I want to list all the routes in the backend app.
since I am using the express-promise-router, I can't use the app._router.stack
The problem I am facing is that I used "sub-routing":
app.use('/api/v1', require('./router'));
in router.js:
router.use('/api/v1/user', require('./user_r'));
in user_r.js:
router.get(...)
all the dependencies I tried, such as express-list-routes and express-list-endpoints weren't useful because of the hierarchy.
I did though try suggestions from here:
Any suggestions how to get it done?