diff --git a/lib/server/main.js b/lib/server/main.js index 15ad6789..d189191e 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -52,6 +52,7 @@ /* Functions */ exports.generateHeaders = generateHeaders, exports.sendFile = sendFile, + exports.require = mrequire, exports.librequire = librequire, exports.srvrequire = srvrequire, @@ -91,7 +92,7 @@ * second initializing after all modules load, so global var is * totally filled of all information that should know all modules */ - var main = global.cloudcmd.main = exports; + global.cloudcmd.main = exports; /** * function do safe require of needed module @@ -99,7 +100,7 @@ */ function mrequire(pSrc){ var lModule, - lError = Util.tryCatch(function(){ + lError = Util.tryCatchLog(function(){ lModule = require(pSrc); }); @@ -112,7 +113,7 @@ function rootrequire(pSrc){ return mrequire(DIR + pSrc); } function librequire(pSrc){ return mrequire(LIBDIR + pSrc); } - + function srvrequire(pSrc){ return mrequire(SRVDIR + pSrc); } /** @@ -167,8 +168,8 @@ lRet['content-encoding'] = 'gzip'; return lRet; -} - + } + /** * send file to client thru pipe * and gzip it if client support