minor changes

This commit is contained in:
coderaiser 2012-11-15 07:30:06 -05:00
parent 4d5d121396
commit 5f29cef524
3 changed files with 16 additions and 7 deletions

View file

@ -85,7 +85,7 @@
*/
function rest(pConnectionData){
console.log('rest');
Util.exec(main.rest, pConnectionData);
return Util.exec(main.rest, pConnectionData);
}
function readConfig(){

View file

@ -14,7 +14,8 @@
* @pConnectionData {request, responce}
*/
exports.rest = function(pConnectionData){
var lReq = pConnectionData.request,
var lRet = false,
lReq = pConnectionData.request,
lRes = pConnectionData.response,
lUrl = lReq.url,
lMethod = lReq.method;
@ -22,8 +23,12 @@
console.log(lUrl);
console.log(lMethod);
if( Util.isContainStr(lUrl, APIURL) )
if( Util.isContainStr(lUrl, APIURL) ){
console.log('api !!!!!!!!!!!! ');
return true;
}
return lRet;
/*
switch(req.method){
case 'GET':

View file

@ -299,19 +299,23 @@ CloudServer._controller = function(pReq, pRes)
lFS_s = CloudFunc.FS;
console.log("request for " + pathname + " received...");
if( lConfig.rest )
Util.exec(CloudServer.rest, {
if( lConfig.rest ){
var lRestWas = Util.exec(CloudServer.rest, {
request : pReq,
response : pRes
});
if(lRestWas)
return;
}
/* если в пути нет информации ни о ФС,
* ни об отсутствии js,
* ни о том, что это корневой
* каталог - загружаем файлы проэкта
*/
else if ( !Util.isContainStr(pathname, lFS_s) &&
if ( !Util.isContainStr(pathname, lFS_s) &&
!Util.isContainStr(pathname, lNoJS_s) &&
!Util.strCmp(pathname, '/') &&
!Util.strCmp(lQuery, 'json') ) {