I have a express.js application which is working fine. But it is getting big and sometimes I get confused if a certain route is already defined or not. I need a way to see the routes that my express app is serving.
I want to see it on runtime either in terminal or in the inspector of chrome. I am using --inspect option when I start my app. I don't want to use some node module and write code in my app to see routes all the time in terminal. It should be on demand basis. I remember some feature like this present in Ruby on Rails - I guess it was rake routes or something. Need help on this, it will make my life easy.
I used app._router.stack. The problem with it is that I cannot see the routes defined in the mounted routes.
I have formed subroutes - /admin and /api. These subroutes are again combinations of other subroutes. The hierarchy may get more deeper as the application grows. The app._router.stack isn't going to work and writing 'someRouter.stack' for each subroute and console.log it is not a solution for me.