Add support for --private to server.js (for my private builds only)
This commit is contained in:
parent
f1168bc837
commit
cb9aef4185
2 changed files with 22 additions and 8 deletions
|
|
@ -88,6 +88,11 @@ var fServerDebug = false;
|
|||
*/
|
||||
var logFile = null;
|
||||
|
||||
/*
|
||||
* fPrivate determines the insertion of private.js
|
||||
*/
|
||||
var fPrivate = false;
|
||||
|
||||
/*
|
||||
* fRebuild controls the rebuilding of cached "index.html" files, assuming fCache is true; fRebuild is false
|
||||
* by default, and it can be set for all requests using the setOptions() 'rebuild' property, or for individual
|
||||
|
|
@ -674,6 +679,7 @@ HTMLOut.logError = function(err, fForce)
|
|||
* 'console' fConsole
|
||||
* 'debug' fServerDebug
|
||||
* 'logfile' logFile
|
||||
* 'private' fPrivate
|
||||
* 'rebuild' fRebuild
|
||||
* 'senddef' fSendDefault
|
||||
* 'sockets' fSockets
|
||||
|
|
@ -698,6 +704,9 @@ HTMLOut.setOptions = function(options)
|
|||
logFile = options['logfile'];
|
||||
HTTPAPI.setLogFile(logFile);
|
||||
}
|
||||
if (options['private'] !== undefined) {
|
||||
fPrivate = options['private'];
|
||||
}
|
||||
if (options['rebuild'] !== undefined) {
|
||||
fRebuild = options['rebuild'];
|
||||
}
|
||||
|
|
@ -1872,15 +1881,19 @@ HTMLOut.prototype.processMachines = function(aMachines, buildOptions, done)
|
|||
*/
|
||||
if ((asFiles = aMachineFiles[sClass].slice())) {
|
||||
var i;
|
||||
if (fNoDebug) {
|
||||
/*
|
||||
* We need to find the shared "defines.js" source file, and follow it with "nodebug.js".
|
||||
*/
|
||||
for (i = 0; i < asFiles.length; i++) {
|
||||
if (asFiles[i].indexOf("shared/lib/defines.js") >= 0) {
|
||||
asFiles.splice(i + 1, 0, asFiles[i].replace("defines.js", "nodebug.js"));
|
||||
break;
|
||||
/*
|
||||
* We need to find the shared "defines.js" source file, because we may need to follow it
|
||||
* with "nodebug.js" and/or "private.js".
|
||||
*/
|
||||
for (i = 0; i < asFiles.length; i++) {
|
||||
if (asFiles[i].indexOf("shared/lib/defines.js") >= 0) {
|
||||
if (fPrivate) {
|
||||
asFiles.splice(i + 1, 0, asFiles[i].replace("defines.js", "private.js"));
|
||||
}
|
||||
if (fNoDebug) {
|
||||
asFiles.splice(i + 1, 0, asFiles[i].replace("defines.js", "nodebug.js"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!fDebugger) {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ var fCache = (args.argv['cache'] === undefined? true : args.argv['cache']);
|
|||
var fConsole = (args.argv['console'] === undefined? false : args.argv['console']);
|
||||
var fDebug = (args.argv['debug'] === undefined? false : args.argv['debug']);
|
||||
var fLogging = (args.argv['logging'] === undefined? false : args.argv['logging']);
|
||||
var fPrivate = (args.argv['private'] === undefined? false : args.argv['private']);
|
||||
var fRebuild = (args.argv['rebuild'] === undefined? false : args.argv['rebuild']);
|
||||
var fSockets = (args.argv['sockets'] === undefined? false : args.argv['sockets']);
|
||||
|
||||
|
|
@ -72,7 +73,7 @@ HTMLOut.setRoot(sServerRoot);
|
|||
* 'debug' and 'rebuild' options OFF, which is why we warn if they're enabled.
|
||||
*/
|
||||
if (fConsole || fDebug || fRebuild) console.log("warning: non-production options enabled");
|
||||
HTMLOut.setOptions({'cache': fCache, 'console': fConsole, 'debug': fDebug, 'rebuild': fRebuild, 'sockets': fSockets});
|
||||
HTMLOut.setOptions({'cache': fCache, 'console': fConsole, 'debug': fDebug, 'private': fPrivate, 'rebuild': fRebuild, 'sockets': fSockets});
|
||||
|
||||
var app = express();
|
||||
app.enable("strict routing");
|
||||
|
|
|
|||
Loading…
Reference in a new issue