From af28bd49ef7b6725cb8ca77cc095b883a569c252 Mon Sep 17 00:00:00 2001 From: Owen Rees Date: Tue, 13 Jun 2023 10:25:12 +0200 Subject: [PATCH] env update --- .env | 1 - .env.development | 1 + .env.production | 1 + utils/getTournamentData.tsx | 6 +----- 4 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 .env create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env b/.env deleted file mode 100644 index 7cca59e..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_HOSTNAME = "https://echecsfrance.vercel.app" diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..2d5dec9 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +NEXT_PUBLIC_URL=http://localhost:3000 diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..1116083 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL diff --git a/utils/getTournamentData.tsx b/utils/getTournamentData.tsx index 62b0437..b49a35a 100644 --- a/utils/getTournamentData.tsx +++ b/utils/getTournamentData.tsx @@ -3,11 +3,7 @@ * @remarks The result is cached for the revalidation period in seconds */ export default async function getTournaments(country: string) { - const server = - process.env.NODE_ENV === "production" - ? process.env.NEXT_PUBLIC_HOSTNAME - : "http://localhost:3000"; - + const server = process.env.SERVER; const res = await fetch(`${server}/api/tournaments/${country}`, { next: { revalidate: 300 }, });