From 88e2e3d62677f6af58b19d8e5d4d789b96d525db Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 3 Jun 2026 09:58:12 -0700 Subject: move songs.ts to be entirely server side --- src/helpers/fetchSongs.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/helpers/fetchSongs.ts') diff --git a/src/helpers/fetchSongs.ts b/src/helpers/fetchSongs.ts index 5ae0d83..b403a52 100644 --- a/src/helpers/fetchSongs.ts +++ b/src/helpers/fetchSongs.ts @@ -6,12 +6,13 @@ function fuzzyMatch(input: string): string { export async function fetchSongs(useCache=true): Promise { + const API_URL = process.env.REACT_APP_HEARDLE_API_URL || "http://localhost:3001"; if (useCache && cachedSongs) { return cachedSongs; } try { - const response = await fetch('/songs'); + const response = await fetch(`${API_URL}/songs`); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } -- cgit v1.2.3