From 0424996e313464a85528d6e1d78a8449a7ab1e82 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 21 Jan 2021 13:33:46 +1300 Subject: [PATCH] Add server setting for local instance origin --- background/feed-update.js | 2 +- utils/constants.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/background/feed-update.js b/background/feed-update.js index 9b71187..917a86b 100644 --- a/background/feed-update.js +++ b/background/feed-update.js @@ -74,7 +74,7 @@ class Refresher { } refreshChannel(ucid) { - return fetch(`http://localhost:3000/api/v1/channels/${ucid}/latest`).then(res => res.json()).then(root => { + return fetch(`${constants.server_setup.local_instance_origin}/api/v1/channels/${ucid}/latest`).then(res => res.json()).then(root => { if (Array.isArray(root)) { root.forEach(video => { // organise diff --git a/utils/constants.js b/utils/constants.js index e8d367e..380bf20 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -16,6 +16,10 @@ let constants = { } }, + server_setup: { + local_instance_origin: "http://localhost:3000" + }, + caching: { csrf_time: 4*60*60*1000, seen_token_subscriptions_eligible: 40*60*60*1000,