daveappserver 0.5.51 → 0.5.52

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.
Files changed (2) hide show
  1. package/appserver.js +25 -3
  2. package/package.json +1 -1
package/appserver.js CHANGED
@@ -1,4 +1,4 @@
1
- var myVersion = "0.5.51", myProductName = "daveAppServer";
1
+ var myVersion = "0.5.52", myProductName = "daveAppServer";
2
2
 
3
3
  exports.start = startup;
4
4
  exports.notifySocketSubscribers = notifySocketSubscribers;
@@ -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, //11/9/21 by DW
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) {
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "daveappserver",
3
3
  "description": "Factored code that was appearing in all my servers.",
4
- "version": "0.5.51",
4
+ "version": "0.5.52",
5
5
  "main": "appserver.js",
6
6
  "repository": {
7
7
  "type" : "git",