daveappserver 0.6.2 → 0.6.5

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 +20 -2
  2. package/package.json +1 -1
package/appserver.js CHANGED
@@ -1,4 +1,4 @@
1
- var myVersion = "0.6.2", myProductName = "daveAppServer";
1
+ var myVersion = "0.6.5", 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;
@@ -1080,6 +1079,24 @@ function startup (options, callback) {
1080
1079
  config.twitter.userLogonCallback = userLogonCallback; //8/14/22 by DW
1081
1080
  davetwitter.start (config.twitter);
1082
1081
  }
1082
+ function startDavemail () { //1/23/23 by DW
1083
+ var options;
1084
+ if (config.smtpHost === undefined) {
1085
+ options = {
1086
+ flUseSes: true
1087
+ };
1088
+ }
1089
+ else {
1090
+ options = {
1091
+ flUseSes: false,
1092
+ smtpHost: config.smtpHost,
1093
+ port: config.smtpPort,
1094
+ username: config.smtpUsername,
1095
+ password: config.smtpPassword
1096
+ };
1097
+ }
1098
+ mail.start (options);
1099
+ }
1083
1100
  function handleHttpRequest (theRequest) {
1084
1101
  const params = theRequest.params;
1085
1102
  const token = params.oauth_token;
@@ -1503,6 +1520,7 @@ function startup (options, callback) {
1503
1520
  console.log ("\n" + config.productName + " v" + config.version + " running on port " + config.port + ".\n");
1504
1521
  console.log ("config == " + utils.jsonStringify (config));
1505
1522
  startDavetwitter (handleHttpRequest);
1523
+ startDavemail (); //1/23/23 by DW
1506
1524
  if (config.myDomain === undefined) {
1507
1525
  console.log ("startup: can't start the server because config.myDomain is not defined.");
1508
1526
  }
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.2",
4
+ "version": "0.6.5",
5
5
  "main": "appserver.js",
6
6
  "repository": {
7
7
  "type" : "git",