fixed api url.
This commit is contained in:
parent
8453777896
commit
ef84273642
1
.env
1
.env
@ -1,2 +1,3 @@
|
|||||||
APP_NAME=portfolio
|
APP_NAME=portfolio
|
||||||
APP_LANG=en_US
|
APP_LANG=en_US
|
||||||
|
APP_URL=https://refansa.vercel.app
|
@ -6,7 +6,8 @@ export const metadata: Metadata = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getProjectLists() {
|
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.')
|
if (!res.ok) throw new Error('Failed to fetch project lists.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user