diff options
author | Ollie H <renahlee@outlook.com> | 2023-05-30 18:08:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 20:08:49 -0500 |
commit | c0ca27b7ce6518758323e2922e66a3e3a008dbce (patch) | |
tree | dd3611dff125cc3013e690a3fd19c20703dae5bb /src/lib/constants.ts | |
parent | 2018558585fd7b955598c8584751bbdd9c6ff227 (diff) | |
download | voidsky-c0ca27b7ce6518758323e2922e66a3e3a008dbce.tar.zst |
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 <anshnanda10@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/lib/constants.ts')
-rw-r--r-- | src/lib/constants.ts | 15 |
1 files changed, 15 insertions, 0 deletions
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 + } +} |