mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-24 00:21:18 +00:00
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:
parent
32ed528c38
commit
9ce26c1640
9 changed files with 76 additions and 80 deletions
25
cloudcmd.js
25
cloudcmd.js
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue