mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-02 13:58:18 -05:00
Fix og url for local
This commit is contained in:
@@ -107,3 +107,5 @@ export const RESERVED_PATHS = [
|
||||
'web',
|
||||
'welcome',
|
||||
]
|
||||
|
||||
export const LOCAL_WEB_URL = 'http://localhost:3000';
|
||||
|
||||
@@ -24,5 +24,5 @@ export function getLoveOgImageUrl(user: User, lover?: LoverRow | null) {
|
||||
gender: lover?.gender ?? '???',
|
||||
} as LoveOgProps
|
||||
|
||||
return buildOgUrl(loveProps, 'lover', 'compassmeet.com')
|
||||
return buildOgUrl(loveProps, 'lover')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DOMAIN } from 'common/envs/constants'
|
||||
import {DOMAIN, LOCAL_WEB_URL} from 'common/envs/constants'
|
||||
import {LOCAL_DEV} from "shared/lib/utils";
|
||||
|
||||
// opengraph functions that run in static props or client-side, but not in the edge (in image creation)
|
||||
|
||||
@@ -10,10 +11,5 @@ export function buildOgUrl<P extends Record<string, string>>(
|
||||
const generateUrlParams = (params: P) =>
|
||||
new URLSearchParams(params).toString()
|
||||
|
||||
// Change to localhost:3000 for local testing
|
||||
const url =
|
||||
// `http://localhost:3000/api/og/${endpoint}?` + generateUrlParams(props)
|
||||
`https://${domain ?? DOMAIN}/api/og/${endpoint}?` + generateUrlParams(props)
|
||||
|
||||
return url
|
||||
return `https://${domain ?? LOCAL_DEV ? LOCAL_WEB_URL : DOMAIN}/api/og/${endpoint}?` + generateUrlParams(props)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user