updated siteConfig to be a constructor
This commit is contained in:
parent
0e9455278e
commit
532702c095
2 changed files with 22 additions and 14 deletions
|
@ -1,26 +1,35 @@
|
|||
module.exports = {
|
||||
analytics: {
|
||||
function SiteConfig () {
|
||||
this.analytics = {
|
||||
googleId: 'default',
|
||||
},
|
||||
publishing: {
|
||||
};
|
||||
this.publishing = {
|
||||
primaryClaimAddress : 'default',
|
||||
additionalClaimAddresses: [],
|
||||
thumbnailChannel : 'default',
|
||||
thumbnailChannelId : 'default',
|
||||
uploadDirectory : '/home/lbry/Uploads',
|
||||
},
|
||||
details: {
|
||||
};
|
||||
this.details = {
|
||||
title : 'Spee<h',
|
||||
name : 'Spee.ch',
|
||||
host : 'https://dev1.spee.ch',
|
||||
description: 'Open-source, decentralized image and video sharing.',
|
||||
},
|
||||
assetDefaults: {
|
||||
};
|
||||
this.assetDefaults = {
|
||||
title : 'dev1 Spee.ch',
|
||||
thumbnail : 'https://spee.ch/assets/img/video_thumb_default.png',
|
||||
description: 'Open-source, decentralized image and video sharing.',
|
||||
},
|
||||
session: {
|
||||
};
|
||||
this.session = {
|
||||
sessionKey: 'default',
|
||||
},
|
||||
};
|
||||
this.configure = ({analytics, publishing, details, assetDefaults, session}) => {
|
||||
if (analytics) this.analytics = analytics;
|
||||
if (publishing) this.publishing = publishing;
|
||||
if (details) this.details = details;
|
||||
if (assetDefaults) this.assetDefaults = assetDefaults;
|
||||
if (session) this.session = session;
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = new SiteConfig();
|
||||
|
|
|
@ -26,11 +26,10 @@ function SpeechServer ({ mysqlConfig, siteConfig, slackConfig }) {
|
|||
this.configureConfigFiles = () => {
|
||||
const mysqlAppConfig = require('./config/mysqlConfig.js');
|
||||
mysqlAppConfig.configure(mysqlConfig);
|
||||
const siteAppConfig = require('./config/siteConfig.js');
|
||||
siteAppConfig.configure(siteConfig);
|
||||
const slackAppConfig = require('./config/slackConfig.js');
|
||||
slackAppConfig.configure(slackConfig);
|
||||
// // print the config variables
|
||||
// require('./helpers/configVarCheck.js')(mysqlAppConfig);
|
||||
// require('./helpers/configVarCheck.js')(slackAppConfig);
|
||||
};
|
||||
this.configureLogging = () => {
|
||||
require('./helpers/configureLogger.js')(logger);
|
||||
|
|
Loading…
Reference in a new issue