From ef84273642d03fd71d27ee7d54cd9b2713e84f04 Mon Sep 17 00:00:00 2001 From: Refansa Date: Fri, 27 Oct 2023 19:39:46 +0700 Subject: [PATCH] fixed api url. --- .env | 3 ++- src/app/projects/page.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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.')