minor changes

This commit is contained in:
coderaiser 2013-02-24 09:37:40 -05:00
parent 14f92cc116
commit 6bc24f49a8

View file

@ -37,20 +37,15 @@
lRet = true;
getBody(lReq, function(pBody){
var lCommand = Util.removeStr(lUrl, lAPIURL),
lData = getData({
command : lCommand,
method : lMethod,
body : pBody,
request : lReq,
response : lRes
});
if(lData)
send({
response : lRes,
data : lData
});
var lCommand = Util.removeStr(lUrl, lAPIURL);
getData({
command : lCommand,
method : lMethod,
body : pBody,
request : lReq,
response : lRes
});
});
}
@ -143,12 +138,14 @@
* @param pParams {command, method, body, requrest, response}
*/
function onGET(pParams){
var lResult = {error: 'command not found'},
lCmd = pParams.command;
var lCmd = pParams.command;
switch(lCmd){
case '':
lResult = {info: 'Cloud Commander API v1'};
pParams.data = {
info: 'Cloud Commander API v1'
};
send(pParams);
break;
case 'kill':
@ -156,11 +153,14 @@
mesage: 'Cloud Commander was killed'
};
send(pParams);
lResult = null;
break;
default:
pParams.data = {
error: 'command not found'
};
send(pParams);
break;
}
return lResult;
}
/**