mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 22:54:37 +02:00
More Hot-Reload related changes
* Config.get(): Returns the latest config * Update code all over the place to use Config.get() vs Config.conf (which will be deprecated)
This commit is contained in:
parent
ca0149eaf0
commit
1fe46894d3
42 changed files with 320 additions and 273 deletions
|
@ -2,7 +2,7 @@
|
|||
'use strict';
|
||||
|
||||
// ENiGMA½
|
||||
const Config = require('./config.js').config;
|
||||
const Config = require('./config.js').get;
|
||||
const Errors = require('./enig_error.js').Errors;
|
||||
const Log = require('./logger.js').log;
|
||||
|
||||
|
@ -13,13 +13,14 @@ const nodeMailer = require('nodemailer');
|
|||
exports.sendMail = sendMail;
|
||||
|
||||
function sendMail(message, cb) {
|
||||
if(!_.has(Config, 'email.transport')) {
|
||||
const config = Config();
|
||||
if(!_.has(config, 'email.transport')) {
|
||||
return cb(Errors.MissingConfig('Email "email::transport" configuration missing'));
|
||||
}
|
||||
|
||||
message.from = message.from || Config.email.defaultFrom;
|
||||
message.from = message.from || config.email.defaultFrom;
|
||||
|
||||
const transportOptions = Object.assign( {}, Config.email.transport, {
|
||||
const transportOptions = Object.assign( {}, config.email.transport, {
|
||||
logger : Log,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue