mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
4d5d121396
commit
5f29cef524
3 changed files with 16 additions and 7 deletions
|
|
@ -85,7 +85,7 @@
|
|||
*/
|
||||
function rest(pConnectionData){
|
||||
console.log('rest');
|
||||
Util.exec(main.rest, pConnectionData);
|
||||
return Util.exec(main.rest, pConnectionData);
|
||||
}
|
||||
|
||||
function readConfig(){
|
||||
|
|
|
|||
|
|
@ -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':
|
||||
|
|
|
|||
12
server.js
12
server.js
|
|
@ -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') ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue