diff --git a/.env b/.env index 7d84929..15ab4aa 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ APP_NAME=portfolio -APP_LANG=en_US \ No newline at end of file +APP_LANG=en_US +APP_URL=https://refansa.vercel.app \ No newline at end of file diff --git a/src/app/projects/page.tsx b/src/app/projects/page.tsx index d6e9dd3..40e57c9 100644 --- a/src/app/projects/page.tsx +++ b/src/app/projects/page.tsx @@ -6,7 +6,8 @@ export const metadata: Metadata = { } async function getProjectLists() { - const res = await fetch('http://localhost:3000/api/projects') + const baseURL = process.env.APP_URL ?? 'https://refansa.vercel.app' + const res = await fetch(`${baseURL}/api/projects`) if (!res.ok) throw new Error('Failed to fetch project lists.')