mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
added config.json file
This commit is contained in:
parent
f2cf1406a8
commit
c2346de896
1 changed files with 19 additions and 7 deletions
26
server.js
26
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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue