express js list all routes 1

express js list all routes

const listEndpoints = require("express-list-endpoints"); // npm i express-list-endpoints
console.log(listEndpoints(app)); // where app = express();

Here is what the above code is Doing:
1. We’re requiring the express-list-endpoints module.
2. We’re calling the listEndpoints function and passing in our express app.
3. We’re logging the result to the console.

Similar Posts