aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers/fetchSongs.ts
diff options
context:
space:
mode:
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