From ece07b12d1976765702e67586208309ba186a498 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 31 Jul 2018 09:24:03 -0700 Subject: [PATCH] switched hard coding for configs on channel logic --- .../api/oEmbed/getOEmbedDataForChannel.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/controllers/api/oEmbed/getOEmbedDataForChannel.js b/server/controllers/api/oEmbed/getOEmbedDataForChannel.js index f6908dac..8f2afab3 100644 --- a/server/controllers/api/oEmbed/getOEmbedDataForChannel.js +++ b/server/controllers/api/oEmbed/getOEmbedDataForChannel.js @@ -1,5 +1,12 @@ const db = require('../../../models'); +const { + details: { + host, + title: siteTitle, + }, +} = require('@config/siteConfig'); + const getOEmbedDataForChannel = (channelName, channelClaimId) => { return db.Certificate .findOne({ @@ -12,12 +19,12 @@ const getOEmbedDataForChannel = (channelName, channelClaimId) => { const certificateData = certificateRecord.dataValues; return { version : 1.0, - provider_name: 'Spee.ch', - provider_url : 'https://spee.ch', + provider_name: siteTitle, + provider_url : host, type : 'link', author_name : certificateData.name, title : `${certificateData.name}'s channel on Spee.ch`, - author_url : `https://spee.ch/${certificateData.name}:${certificateData.claimId}`, + author_url : `${host}/${certificateData.name}:${certificateData.claimId}`, cache_age : 86400, // one day in seconds }; });