mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
minor changes
This commit is contained in:
parent
14f92cc116
commit
6bc24f49a8
1 changed files with 20 additions and 20 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue