From c0ca27b7ce6518758323e2922e66a3e3a008dbce Mon Sep 17 00:00:00 2001 From: Ollie H Date: Tue, 30 May 2023 18:08:49 -0700 Subject: Use proxy for fetching link meta (#716) * Use proxy for fetching link meta * Remove link meta test due to hitting proxy * setup different staging and prod proxy URLs --------- Co-authored-by: Ansh Nanda Co-authored-by: Paul Frazee --- src/lib/constants.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index ada7b2059..170fe640f 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -144,3 +144,18 @@ export const POST_IMG_MAX = { height: 2000, size: 1000000, } + +export const STAGING_LINK_META_PROXY = + 'https://cardyb.staging.bsky.dev/v1/extract?url=' + +export const PROD_LINK_META_PROXY = 'https://cardyb.bsky.app/v1/extract?url=' + +export function LINK_META_PROXY(serviceUrl: string) { + if (serviceUrl.includes('localhost')) { + return STAGING_LINK_META_PROXY + } else if (serviceUrl.includes('staging')) { + return STAGING_LINK_META_PROXY + } else { + return PROD_LINK_META_PROXY + } +} -- cgit 1.4.1