Wednesday, 8 March 2017

How to use module.exports for a router?

I have /routes/a.js and /routes/b.jsWithin function b, I have something I want to use with a:I read I should rename the functions I want to be shared to exports.nameOfFunction = function()However, I also read that if you use exports.NameOfFunction you cannot use module.exports = router; at the bottom.How can I include both router AND these functions?(I'm still new - Google contains conflicting info en masse regarding this)

Submitted March 08, 2017 at 01:13PM by xblade724

No comments:

Post a Comment