Hello all. I am using a node express app, that has a directory structure like this:
Each of those directories have index.js files, and individual js files, one for each function for that purpose. Say for example:
Controllers.app.strategyGoogle = module.exports = function ()....
The controller/index.js and controller/app/index.js,controller/api/index.js etc files read in the directories on the fly (fs.readdirSync), so that I can simply create a new file or directory and keep going. I'd prefer to continue to use that, but I've had to shove the actual Controllers.app.strategyGoogle definition in front of the module.exports expression in order to get the IDE to pick up the function reference, knowing that when I require() it, the assignment is going to get overridden anyway.
So I'm wondering if there is a better, more preferred way to structure the thing, rather than simply tossing the idea of reading in the directory.