changed publishing to claim and updated config imports #308
4 changed files with 13 additions and 14 deletions
|
@ -1,25 +1,26 @@
|
||||||
const config = require('./speechConfig.js');
|
const { logging } = require('./speechConfig.js');
|
||||||
|
const { slackWebHook, slackErrorChannel, slackInfoChannel } = logging;
|
||||||
const winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;
|
const winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;
|
||||||
|
|
||||||
module.exports = (winston) => {
|
module.exports = (winston) => {
|
||||||
if (config.logging.slackWebHook) {
|
if (slackWebHook) {
|
||||||
// add a transport for errors to slack
|
// add a transport for errors to slack
|
||||||
if (config.logging.slackErrorChannel) {
|
if (slackErrorChannel) {
|
||||||
winston.add(winstonSlackWebHook, {
|
winston.add(winstonSlackWebHook, {
|
||||||
name : 'slack-errors-transport',
|
name : 'slack-errors-transport',
|
||||||
level : 'warn',
|
level : 'warn',
|
||||||
webhookUrl: config.logging.slackWebHook,
|
webhookUrl: slackWebHook,
|
||||||
channel : config.logging.slackErrorChannel,
|
channel : slackErrorChannel,
|
||||||
username : 'spee.ch',
|
username : 'spee.ch',
|
||||||
iconEmoji : ':face_with_head_bandage:',
|
iconEmoji : ':face_with_head_bandage:',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (config.logging.slackInfoChannel) {
|
if (slackInfoChannel) {
|
||||||
winston.add(winstonSlackWebHook, {
|
winston.add(winstonSlackWebHook, {
|
||||||
name : 'slack-info-transport',
|
name : 'slack-info-transport',
|
||||||
level : 'info',
|
level : 'info',
|
||||||
webhookUrl: config.logging.slackWebHook,
|
webhookUrl: slackWebHook,
|
||||||
channel : config.logging.slackInfoChannel,
|
channel : slackInfoChannel,
|
||||||
username : 'spee.ch',
|
username : 'spee.ch',
|
||||||
iconEmoji : ':nerd_face:',
|
iconEmoji : ':nerd_face:',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
const { returnShortId } = require('../helpers/sequelizeHelpers.js');
|
const { returnShortId } = require('../helpers/sequelizeHelpers.js');
|
||||||
const { publishing, site } = require('../config/speechConfig.js');
|
const { claim, site } = require('../config/speechConfig.js');
|
||||||
const { defaultTitle, defaultThumbnail, defaultDescription } = publishing;
|
const { defaultTitle, defaultThumbnail, defaultDescription } = claim;
|
||||||
const { host } = site;
|
const { host } = site;
|
||||||
|
|
||||||
function determineFileExtensionFromContentType (contentType) {
|
function determineFileExtensionFromContentType (contentType) {
|
||||||
|
|
|
@ -4,9 +4,7 @@ const Sequelize = require('sequelize');
|
||||||
const basename = path.basename(module.filename);
|
const basename = path.basename(module.filename);
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
const config = require('../config/speechConfig.js');
|
const config = require('../config/speechConfig.js');
|
||||||
const database = config.sql.database;
|
const { database, username, password } = config.sql;
|
||||||
const username = config.sql.username;
|
|
||||||
const password = config.sql.password;
|
|
||||||
const db = {};
|
const db = {};
|
||||||
|
|
||||||
// set sequelize options
|
// set sequelize options
|
||||||
|
|
|
@ -3,7 +3,7 @@ const logger = require('winston');
|
||||||
const db = require('../models/index'); // require our models for syncing
|
const db = require('../models/index'); // require our models for syncing
|
||||||
// configure logging
|
// configure logging
|
||||||
const config = require('../config/speechConfig.js');
|
const config = require('../config/speechConfig.js');
|
||||||
const logLevel = config.logging.logLevel;
|
const { logLevel } = config.logging;
|
||||||
require('../config/loggerConfig.js')(logger, logLevel);
|
require('../config/loggerConfig.js')(logger, logLevel);
|
||||||
|
|
||||||
const userName = process.argv[2];
|
const userName = process.argv[2];
|
||||||
|
|
Loading…
Reference in a new issue