From 0536c463dcb0fe78f4fa4b0a30bf733128d925b8 Mon Sep 17 00:00:00 2001 From: Gabriel Medina Date: Wed, 27 Mar 2024 12:57:29 -0400 Subject: [PATCH] feat: make API_URL public --- .env.example | 2 +- src/app/players/page.tsx | 4 ++-- src/app/rankings/page.tsx | 4 ++-- src/app/tournaments/page.tsx | 4 ++-- src/components/{layouts/default.tsx => Layouts/Default.tsx} | 0 5 files changed, 7 insertions(+), 7 deletions(-) rename src/components/{layouts/default.tsx => Layouts/Default.tsx} (100%) diff --git a/.env.example b/.env.example index 47fb0e8..966485d 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -API_URL=http://localhost:8080 +NEXT_PUBLIC_API_URL=http://localhost:8080 diff --git a/src/app/players/page.tsx b/src/app/players/page.tsx index 339ceb4..09442cf 100644 --- a/src/app/players/page.tsx +++ b/src/app/players/page.tsx @@ -1,4 +1,4 @@ -import LayoutDefault from '@/components/layouts/default' +import LayoutDefault from '@/components/Layouts/Default' import { PaginationType } from '@/types/Pagination' import { PlayerType } from '@/types/Player' @@ -21,7 +21,7 @@ export default async function Players() { } async function getPlayers(): Promise> { - const response = await fetch(`${process.env.API_URL}/players`) + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/players`) if (!response.ok) { throw new Error('Failed to fetch players data') diff --git a/src/app/rankings/page.tsx b/src/app/rankings/page.tsx index 6c96628..2132f9f 100644 --- a/src/app/rankings/page.tsx +++ b/src/app/rankings/page.tsx @@ -1,4 +1,4 @@ -import LayoutDefault from '@/components/layouts/default' +import LayoutDefault from '@/components/Layouts/Default' import { PaginationType } from '@/types/Pagination' import { RankingType } from '@/types/Ranking' @@ -21,7 +21,7 @@ export default async function Rankings() { } async function getRankings(): Promise> { - const response = await fetch(`${process.env.API_URL}/rankings`) + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/rankings`) if (!response.ok) { throw new Error('Failed to fetch rankings data') diff --git a/src/app/tournaments/page.tsx b/src/app/tournaments/page.tsx index 5bdd819..c211ddc 100644 --- a/src/app/tournaments/page.tsx +++ b/src/app/tournaments/page.tsx @@ -1,4 +1,4 @@ -import LayoutDefault from '@/components/layouts/default' +import LayoutDefault from '@/components/Layouts/Default' import { PaginationType } from '@/types/Pagination' import { TournamentType } from '@/types/Tournament' import Link from 'next/link' @@ -26,7 +26,7 @@ export default async function Tournaments() { } async function getTournaments(): Promise> { - const response = await fetch(`${process.env.API_URL}/tournaments`) + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/tournaments`) if (!response.ok) { throw new Error('Failed to fetch tournaments data') diff --git a/src/components/layouts/default.tsx b/src/components/Layouts/Default.tsx similarity index 100% rename from src/components/layouts/default.tsx rename to src/components/Layouts/Default.tsx