Skip to content

Commit

Permalink
fix: remove hardcoded URL from SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
visrut-at-incubyte committed Oct 24, 2023
1 parent ac65019 commit 7f54967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const dev = process.env.NODE_ENV !== 'production'
export const server = dev ? 'http://localhost:3000' : 'https://wizardsurvey.fun'
3 changes: 2 additions & 1 deletion app/survey/[id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { server } from '@/app/config'
import { AppProvider } from '@/app/context/AppContext'
import { Metadata, ResolvingMetadata } from 'next'

Expand All @@ -7,7 +8,7 @@ export async function generateMetadata(
): Promise<Metadata> {
const id = params.id

const survey = await fetch(`http://localhost:3000/survey/${id}/api`).then((res) => res.json())
const survey = await fetch(`${server}/survey/${id}/api`).then((res) => res.json())

const previousImages = (await parent).openGraph?.images || []

Expand Down

0 comments on commit 7f54967

Please sign in to comment.