daveappserver 0.5.50 → 0.5.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/appserver.js +27 -5
- package/package.json +1 -1
package/appserver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myVersion = "0.5.
|
|
1
|
+
var myVersion = "0.5.53", myProductName = "daveAppServer";
|
|
2
2
|
|
|
3
3
|
exports.start = startup;
|
|
4
4
|
exports.notifySocketSubscribers = notifySocketSubscribers;
|
|
@@ -48,7 +48,7 @@ var config = {
|
|
|
48
48
|
|
|
49
49
|
defaultContentType: "text/plain", //8/3/21 by DW
|
|
50
50
|
|
|
51
|
-
userAgent: myProductName + " v" + myVersion //11/8/21 by DW
|
|
51
|
+
userAgent: myProductName + " v" + myVersion, //11/8/21 by DW
|
|
52
52
|
|
|
53
53
|
whitelist: undefined //7/21/22 by DW
|
|
54
54
|
};
|
|
@@ -1012,6 +1012,16 @@ function startup (options, callback) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
function returnServerHomePage () {
|
|
1014
1014
|
function servePage (templatetext) {
|
|
1015
|
+
|
|
1016
|
+
function arrayToParam (theArray) { //7/21/22 by DW
|
|
1017
|
+
if (theArray === undefined) {
|
|
1018
|
+
return (undefined);
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
return (JSON.stringify (theArray));
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1015
1025
|
var pagetable = {
|
|
1016
1026
|
productName: config.productName,
|
|
1017
1027
|
productNameForDisplay: config.productNameForDisplay,
|
|
@@ -1021,8 +1031,7 @@ function startup (options, callback) {
|
|
|
1021
1031
|
flEnableLogin: config.flEnableLogin,
|
|
1022
1032
|
prefsPath: config.prefsPath,
|
|
1023
1033
|
docsPath: config.docsPath,
|
|
1024
|
-
idGitHubClient: config.githubClientId
|
|
1025
|
-
whitelist: config.whitelist //7/21/22 by DW
|
|
1034
|
+
idGitHubClient: config.githubClientId //11/9/21 by DW
|
|
1026
1035
|
};
|
|
1027
1036
|
if (theRequest.addToPagetable !== undefined) { //3/9/21 by DW
|
|
1028
1037
|
for (var x in theRequest.addToPagetable) {
|
|
@@ -1030,7 +1039,7 @@ function startup (options, callback) {
|
|
|
1030
1039
|
}
|
|
1031
1040
|
}
|
|
1032
1041
|
if (config.addMacroToPagetable !== undefined) {
|
|
1033
|
-
config.addMacroToPagetable (pagetable);
|
|
1042
|
+
config.addMacroToPagetable (pagetable, theRequest); //8/10/22 by DW
|
|
1034
1043
|
}
|
|
1035
1044
|
var pagetext = utils.multipleReplaceAll (templatetext.toString (), pagetable, false, "[%", "%]");
|
|
1036
1045
|
returnHtml (pagetext);
|
|
@@ -1221,6 +1230,19 @@ function startup (options, callback) {
|
|
|
1221
1230
|
getGithubUserInfo (params.username, params.accessToken, httpReturn);
|
|
1222
1231
|
});
|
|
1223
1232
|
return (true);
|
|
1233
|
+
case "/useriswhitelisted": //7/21/22 by DW
|
|
1234
|
+
callWithScreenname (function (screenname) {
|
|
1235
|
+
var flWhitelisted = false;
|
|
1236
|
+
if (config.whitelist === undefined) {
|
|
1237
|
+
flWhitelisted = true;
|
|
1238
|
+
}
|
|
1239
|
+
else {
|
|
1240
|
+
flWhitelisted = config.whitelist.includes (screenname);
|
|
1241
|
+
}
|
|
1242
|
+
console.log ("/useriswhitelisted: screenname == " + screenname + ", flWhitelisted == " + flWhitelisted);
|
|
1243
|
+
returnData ({flWhitelisted});
|
|
1244
|
+
});
|
|
1245
|
+
return (true);
|
|
1224
1246
|
|
|
1225
1247
|
}
|
|
1226
1248
|
break;
|