Skip to content

Commit

Permalink
refactor: add NEXT_PUBLIC_VERCEL_URL to env file
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn committed Dec 7, 2024
1 parent 27aea94 commit 071b60c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ NEXT_PUBLIC_CDN_URL=https://stg-media.openbeta.io

NEXT_PUBLIC_API_SERVER=https://stg-api.openbeta.io

NEXT_PUBLIC_VERCEL_URL=$VERCEL_URL

# Disable telemetry
NEXT_TELEMETRY_DISABLED=1

Expand Down
3 changes: 2 additions & 1 deletion src/app/(default)/components/SharePageURLButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { ControlledTooltip } from '@/components/ui/Tooltip'
*/
export const SharePageURLButton: React.FC<{ path: string, name: string }> = ({ path, name }) => {
const slug = getFriendlySlug(name)
const baseUrl = process.env.VERCEL_URL != null ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000'
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL != null ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : 'http://localhost:3000'
console.log(process.env.NEXT_PUBLIC_VERCEL_URL)
const optionalSlug = slug !== '' ? `/${slug}` : ''
const url = `${baseUrl}${path}${optionalSlug}`

Expand Down

0 comments on commit 071b60c

Please sign in to comment.