Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Make sure these are defined;
  2. // Be sure to change your variable names if you name things otherwise
  3. // var express = require('express');
  4. // var app = express();
  5.  
  6. app._router.stack.forEach(item => {
  7. if(item.route !== undefined
  8. && item.route.path !== undefined){
  9. console.log(`${item.route.stack[0].method.toUpperCase()}: ${item.route.path}`);
  10. }
  11. })
  12.  
  13. // Returns something like this. 'GET /your/route/with/:params/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement