Skip to content

Commit

Permalink
feat: make API_URL public
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmedina committed Mar 27, 2024
1 parent 696740f commit 0536c46
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
API_URL=http://localhost:8080
NEXT_PUBLIC_API_URL=http://localhost:8080
4 changes: 2 additions & 2 deletions src/app/players/page.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -21,7 +21,7 @@ export default async function Players() {
}

async function getPlayers(): Promise<PaginationType<PlayerType>> {
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')
Expand Down
4 changes: 2 additions & 2 deletions src/app/rankings/page.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -21,7 +21,7 @@ export default async function Rankings() {
}

async function getRankings(): Promise<PaginationType<RankingType>> {
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')
Expand Down
4 changes: 2 additions & 2 deletions src/app/tournaments/page.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -26,7 +26,7 @@ export default async function Tournaments() {
}

async function getTournaments(): Promise<PaginationType<TournamentType>> {
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')
Expand Down
File renamed without changes.

0 comments on commit 0536c46

Please sign in to comment.