From 246274a9af178e0784a92086816214b1363b1065 Mon Sep 17 00:00:00 2001 From: Cadence Fish Date: Wed, 29 Jan 2020 00:38:05 +1300 Subject: [PATCH] Add instances API --- src/lib/constants.js | 7 ++++++- src/site/api/api.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/constants.js b/src/lib/constants.js index f9402bf..2b0b5a7 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -11,7 +11,8 @@ let constants = { // Things that server owners _could_ change if they want to. caching: { image_cache_control: `public, max-age=${7*24*60*60}`, - resource_cache_time: 30*60*1000 + resource_cache_time: 30*60*1000, + instance_list_cache_time: 3*60*1000 }, // Instagram uses this stuff. This shouldn't be changed, except to fix a bug that hasn't yet been fixed upstream. @@ -23,6 +24,10 @@ let constants = { shortcode_regex: "[\\w-]+" }, + resources: { + instances_wiki_raw: "https://raw.githubusercontent.com/wiki/cloudrac3r/bibliogram/Instances.md" + }, + // My code uses this stuff. Server owners have no reason to change it. symbols: { NO_MORE_PAGES: Symbol("NO_MORE_PAGES"), diff --git a/src/site/api/api.js b/src/site/api/api.js index d463557..01e3090 100644 --- a/src/site/api/api.js +++ b/src/site/api/api.js @@ -70,7 +70,8 @@ module.exports = [ "PAGE_PROFILE", "PAGE_POST", "API_STATS", - "PAGE_HOME" + "PAGE_HOME", + "API_INSTANCES" ] } }