minor changes

This commit is contained in:
coderaiser 2013-02-04 06:43:06 -05:00
parent 2382fcbfaf
commit 1e7ea49a75
2 changed files with 15 additions and 12 deletions

View file

@ -17,11 +17,14 @@
Server = main.require(LIBDIR + 'server'),
Minify = Server.Minify,
srv = Server.CloudServer,
Config = main.config;
Config = main.config,
REQUEST = 'request',
RESPONSE = 'response';
/* reinit main dir os if we on
* Win32 should be backslashes */
DIR = main.DIR;
DIR = main.DIR,
readConfig();
Server.start(Config, {
@ -199,14 +202,12 @@
}else if( Util.isContainStr(lName, [CloudFunc.Fs, CloudFunc.NoJS] ) ||
Util.strCmp(lName, '/') ||
Util.strCmp(lName, 'json') ) {
main.commander.sendContent({
request : pParams.request,
response : pParams.response,
indexProcessing : indexProcessing
lRet = main.commander.sendContent({
request : pParams[REQUEST],
response : pParams[RESPONSE],
processing : indexProcessing
});
lRet = true;
}
}
return lRet;
}

View file

@ -26,6 +26,8 @@
NO_JS = CloudFunc.NoJS,
FS = CloudFunc.Fs,
INDEX = HTMLDIR + 'index.html',
REQUEST = 'request',
RESPONSE = 'response',
IndexProcessingFunc = null;
@ -33,7 +35,7 @@
exports.sendContent = function(pParams){
var lRet = Util.checkObj(pParams,
['processing'],
['request', 'response']);
[REQUEST, RESPONSE]);
if(lRet){
var lReq = pParams.request,
@ -257,7 +259,7 @@
if(lRet)
lRet = Util.checkObj(pParams.params,
['callback'], ['request', 'response', 'name', 'list']);
['callback'], [REQUEST, RESPONSE, 'name', 'list']);
if(lRet){
var p = pParams,
@ -399,7 +401,7 @@
*/
function sendResponse(pParams){
var lRet = Util.checkObjTrue(pParams,
['name', 'data', 'request', 'response']);
['name', 'data', REQUEST, RESPONSE]);
if(lRet){
var p = pParams;