Skip to content

Commit b1d6a3e

Browse files
committed
fixing api urls
1 parent 3fa8e69 commit b1d6a3e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.env.development

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_SITE_URL=http://localhost:3000

app/application/[applicationId]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import AppDetails from "../../../components/AppDetails";
55

66
const ApplicationPage = async ({ params }: { params: any }) => {
77
const response = await fetch(
8-
`http://localhost:3000/api/application/${params.applicationId}`
8+
`${process.env.NEXT_PUBLIC_SITE_URL}/api/application/${params.applicationId}`
99
);
1010

1111
const application: IApplication = await response.json();

app/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import AllApps from "../components/AllApps";
66
const inter = Inter({ subsets: ["latin"] });
77

88
const Home = async () => {
9-
const response = await fetch("http://localhost:3000/api", { next: { revalidate: 5 } });
9+
10+
const response = await fetch(`${process.env.NEXT_PUBLIC_SITE_URL}/api`, { next: { revalidate: 5 } });
1011
const applications = await response.json();
1112

1213
return (

0 commit comments

Comments
 (0)