From c2346de89692e261b150d31f0f8a03e1bc585b62 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 4 Jul 2012 10:35:26 -0400 Subject: [PATCH] added config.json file --- server.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/server.js b/server.js index cc59f96c..47d9b7e4 100644 --- a/server.js +++ b/server.js @@ -184,17 +184,29 @@ CloudServer.init=(function(){ console.log('server dir: ' + lServerDir); process.chdir(lServerDir); + var lConfig={ + "cache" : {"allowed" : true}, + "minification" : { + "js" : true, + "css" : true, + "html" : true, + "img" : true + } + }; + try{ + lConfig=require('./config'); + }catch(pError){ + console.log('warning: configureation file not found...\n' + + 'using default values...\n' + + lConfig); + } + /* Переменная в которой храниться кэш*/ - CloudServer.Cache.setAllowed(true); + CloudServer.Cache.setAllowed(lConfig.cache.allowed); /* Change default parameters of * js/css/html minification */ - CloudServer.Minify.setAllowed({ - js:true, - css:true, - html:true, - img:true - }); + CloudServer.Minify.setAllowed(lConfig.minification); /* Если нужно минимизируем скрипты */ CloudServer.Minify.doit(); });