mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
mino changes
This commit is contained in:
parent
21f0abedf4
commit
7d9c389a4e
3 changed files with 38 additions and 36 deletions
28
cloudcmd.js
28
cloudcmd.js
|
|
@ -24,6 +24,7 @@
|
|||
REQUEST = 'request',
|
||||
RESPONSE = 'response',
|
||||
INDEX = HTMLDIR + 'index.html',
|
||||
CONFIG_PATH = JSONDIR + 'config.json',
|
||||
FS = CloudFunc.FS;
|
||||
|
||||
/* reinit main dir os if we on
|
||||
|
|
@ -130,7 +131,14 @@
|
|||
}
|
||||
|
||||
function init(){
|
||||
server.start(Config, {
|
||||
fs.watch(CONFIG_PATH, function(){
|
||||
/* every catch up - calling twice */
|
||||
setTimeout(function() {
|
||||
readConfig();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
server.start({
|
||||
appcache : appCacheProcessing,
|
||||
minimize : minimize,
|
||||
rest : rest,
|
||||
|
|
@ -179,28 +187,22 @@
|
|||
}
|
||||
|
||||
function readConfig(pCallBack){
|
||||
var lConfPath = JSONDIR + 'config.json';
|
||||
|
||||
fs.readFile(lConfPath, function(pError, pData){
|
||||
fs.readFile(CONFIG_PATH, function(pError, pData){
|
||||
if(!pError){
|
||||
Util.log('config: readed');
|
||||
|
||||
var lStr = pData.toString();
|
||||
Util.log( lStr );
|
||||
main.config = Config = JSON.parse(lStr);
|
||||
|
||||
Util.tryCatchLog(function(){
|
||||
Minify.setAllowed(main.config.minify);
|
||||
});
|
||||
}
|
||||
else
|
||||
Util.log(pError);
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
|
||||
if(!Config)
|
||||
fs.watch(lConfPath, function(){
|
||||
/* every catch up - calling twice */
|
||||
setTimeout(function() {
|
||||
readConfig();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue