From c9b98306e0833d10c9b5e7623a5afb494472dcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 26 Mar 2015 12:42:25 -0400 Subject: [PATCH] dont require everything in folder dont want rooms.js to be public --- src/socket.io/index.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/socket.io/index.js b/src/socket.io/index.js index e0fd83f7b7..a2cc3a241e 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -151,17 +151,12 @@ function onMessage(socket, payload) { } function requireModules() { - fs.readdir(__dirname, function(err, files) { - files.splice(files.indexOf('index.js'), 1); + var modules = ['admin', 'categories', 'groups', 'meta', 'modules', + 'notifications', 'plugins', 'posts', 'topics', 'user' + ]; - async.each(files, function(lib, next) { - if (lib.substr(lib.length - 3) === '.js') { - lib = lib.slice(0, -3); - Namespaces[lib] = require('./' + lib); - } - - next(); - }); + modules.forEach(function(module) { + Namespaces[module] = require('./' + module); }); }