I'm having some trouble getting my head around express.js routes
If I set up the out-of-the-box hello world app i get a basic setup with a single route
app.get('/', routes.home);
As in the express.js docs, in app.routes my single route has an object like this :
{ path: '/',
method: 'get',
callbacks: [Object],
keys: [],
regexp: /^\/\/?$/i }
but if i console.log into the object
console.log(app.routes.get[0].callbacks[0]);
I get "[Function]" and if I do
console.log(JSON.stringify(app.routes.get[0].callbacks[0]));
I get "undefined" since the callback is a function...
What is going on here, technically ? How can I have a look at the callback I've defined for my route ?