added ability to authorize on github thru new window, changed redirecting url to /auth and added rout function to cloudcmd.js

This commit is contained in:
coderaiser 2012-12-18 06:32:58 -05:00
parent 32ed528c38
commit 9ce26c1640
9 changed files with 76 additions and 80 deletions

View file

@ -6,6 +6,7 @@
LIBDIR = main.LIBDIR,
SRVDIR = main.SRVDIR,
CLIENTDIR = LIBDIR + 'client',
path = main.path,
fs = main.fs,
@ -23,9 +24,10 @@
readConfig();
Server.start(Config, {
index : indexProcessing,
appcache : appCacheProcessing,
rest : rest
index : indexProcessing,
rest : rest,
route : route
});
if(update)
@ -134,6 +136,25 @@
}
}
/**
* routing of server queries
*/
function route(pParams){
Util.log('* Routing');
var lRet,
lName = pParams.name;
if( Util.strCmp(lName, '/auth') ){
Util.log('-> auth');
pParams.name = main.HTMLDIR + lName + '.html';
main.sendFile(pParams);
lRet = true;
}
return lRet;
}
/* function sets stdout to file log.txt */
function writeLogsToFile(){
var stdo = fs.createWriteStream('./log.txt');