dont require everything in folder

dont want rooms.js to be public
v1.18.x
Barış Soner Uşaklı 10 years ago
parent 30104b898c
commit c9b98306e0

@ -151,17 +151,12 @@ function onMessage(socket, payload) {
} }
function requireModules() { function requireModules() {
fs.readdir(__dirname, function(err, files) { var modules = ['admin', 'categories', 'groups', 'meta', 'modules',
files.splice(files.indexOf('index.js'), 1); 'notifications', 'plugins', 'posts', 'topics', 'user'
];
async.each(files, function(lib, next) { modules.forEach(function(module) {
if (lib.substr(lib.length - 3) === '.js') { Namespaces[module] = require('./' + module);
lib = lib.slice(0, -3);
Namespaces[lib] = require('./' + lib);
}
next();
});
}); });
} }

Loading…
Cancel
Save