aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers/fetchSongs.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-03 09:58:12 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-03 09:58:12 -0700
commit88e2e3d62677f6af58b19d8e5d4d789b96d525db (patch)
tree2934d599fa4ef8c830cddf452fbdf7e787b1ca12 /src/helpers/fetchSongs.ts
parentb1c92e09707a423b7b5b01ccb60ba59a91d9f055 (diff)
move songs.ts to be entirely server side
Diffstat (limited to 'src/helpers/fetchSongs.ts')
-rw-r--r--src/helpers/fetchSongs.ts3
1 files changed, 2 insertions, 1 deletions
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<Song[]> {
+ 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}`);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage