daveappserver 0.6.3 → 0.6.6

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 +23 -2
  2. package/package.json +1 -1
package/appserver.js CHANGED
@@ -1,4 +1,4 @@
1
- var myVersion = "0.6.3", myProductName = "daveAppServer";
1
+ var myVersion = "0.6.6", myProductName = "daveAppServer";
2
2
 
3
3
  exports.start = startup;
4
4
  exports.notifySocketSubscribers = notifySocketSubscribers;
@@ -74,7 +74,6 @@ var stats = {
74
74
  const fnameStats = "stats.json";
75
75
 
76
76
 
77
-
78
77
  function userIsWhitelisted (screenname, callback) { //9/16/22 by DW
79
78
  fs.readFile (fnameConfig, function (err, jsontext) {
80
79
  var flWhitelisted = false;
@@ -1078,8 +1077,29 @@ function startup (options, callback) {
1078
1077
  config.twitter.twitterConsumerKey = config.twitterConsumerKey;
1079
1078
  config.twitter.twitterConsumerSecret = config.twitterConsumerSecret;
1080
1079
  config.twitter.userLogonCallback = userLogonCallback; //8/14/22 by DW
1080
+ if (config.urlFavicon !== undefined) { //1/26/23 by DW
1081
+ config.twitter.urlFavicon = config.urlFavicon;
1082
+ }
1081
1083
  davetwitter.start (config.twitter);
1082
1084
  }
1085
+ function startDavemail () { //1/23/23 by DW
1086
+ var options;
1087
+ if (config.smtpHost === undefined) {
1088
+ options = {
1089
+ flUseSes: true
1090
+ };
1091
+ }
1092
+ else {
1093
+ options = {
1094
+ flUseSes: false,
1095
+ smtpHost: config.smtpHost,
1096
+ port: config.smtpPort,
1097
+ username: config.smtpUsername,
1098
+ password: config.smtpPassword
1099
+ };
1100
+ }
1101
+ mail.start (options);
1102
+ }
1083
1103
  function handleHttpRequest (theRequest) {
1084
1104
  const params = theRequest.params;
1085
1105
  const token = params.oauth_token;
@@ -1503,6 +1523,7 @@ function startup (options, callback) {
1503
1523
  console.log ("\n" + config.productName + " v" + config.version + " running on port " + config.port + ".\n");
1504
1524
  console.log ("config == " + utils.jsonStringify (config));
1505
1525
  startDavetwitter (handleHttpRequest);
1526
+ startDavemail (); //1/23/23 by DW
1506
1527
  if (config.myDomain === undefined) {
1507
1528
  console.log ("startup: can't start the server because config.myDomain is not defined.");
1508
1529
  }
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.6.3",
4
+ "version": "0.6.6",
5
5
  "main": "appserver.js",
6
6
  "repository": {
7
7
  "type" : "git",