env update

This commit is contained in:
Owen Rees
2023-06-13 10:25:12 +02:00
parent d8a70d5a63
commit af28bd49ef
4 changed files with 3 additions and 6 deletions
-1
View File
@@ -1 +0,0 @@
NEXT_PUBLIC_HOSTNAME = "https://echecsfrance.vercel.app"
+1
View File
@@ -0,0 +1 @@
NEXT_PUBLIC_URL=http://localhost:3000
+1
View File
@@ -0,0 +1 @@
NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL
+1 -5
View File
@@ -3,11 +3,7 @@
* @remarks The result is cached for the revalidation period in seconds * @remarks The result is cached for the revalidation period in seconds
*/ */
export default async function getTournaments(country: string) { export default async function getTournaments(country: string) {
const server = const server = process.env.SERVER;
process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_HOSTNAME
: "http://localhost:3000";
const res = await fetch(`${server}/api/tournaments/${country}`, { const res = await fetch(`${server}/api/tournaments/${country}`, {
next: { revalidate: 300 }, next: { revalidate: 300 },
}); });