diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-06-03 14:56:18 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-03 14:56:18 -0700 |
| commit | 0ea31947adcdf599f10dfb82a57b0e7fd9164295 (patch) | |
| tree | 7433c0ef243debcd814e214aa5ce49cd976b9e4e /src | |
| parent | ece68c2492481afc37250c99440c6bfc5af6ad53 (diff) | |
migrate project from CRA to vite
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/fetchInfo.ts | 2 | ||||
| -rw-r--r-- | src/helpers/fetchSolution.ts | 4 | ||||
| -rw-r--r-- | src/helpers/fetchSongs.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/helpers/fetchInfo.ts b/src/helpers/fetchInfo.ts index 6da28aa..15cf963 100644 --- a/src/helpers/fetchInfo.ts +++ b/src/helpers/fetchInfo.ts @@ -2,7 +2,7 @@ import { Info } from "../types/info"; export const fetchInfo = async (): Promise<Info> => { - const API_URL = process.env.REACT_APP_HEARDLE_API_URL || "https://localhost:3000"; + const API_URL = import.meta.env.VITE_APP_HEARDLE_API_URL || "http://localhost:3000"; const response = await fetch(`${API_URL}/info`); const data = await response.json(); return data as Info; diff --git a/src/helpers/fetchSolution.ts b/src/helpers/fetchSolution.ts index 5f5e2f3..38872cd 100644 --- a/src/helpers/fetchSolution.ts +++ b/src/helpers/fetchSolution.ts @@ -1,7 +1,7 @@ import { Song } from "../types/song"; -const SALT = process.env.REACT_APP_HEARDLE_SALT ?? 'changeme'; -const API_URL = process.env.REACT_APP_HEARDLE_API_URL ?? 'https://127.0.0.1:3001'; +const SALT = import.meta.env.VITE_HEARDLE_SALT ?? 'changeme'; +const API_URL = import.meta.env.VITE_HEARDLE_API_URL ?? 'https://127.0.0.1:3001'; function hexToBytes(hex: string): Uint8Array { const bytes = new Uint8Array(hex.length / 2); diff --git a/src/helpers/fetchSongs.ts b/src/helpers/fetchSongs.ts index b403a52..f2d91a2 100644 --- a/src/helpers/fetchSongs.ts +++ b/src/helpers/fetchSongs.ts @@ -6,7 +6,7 @@ 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"; + const API_URL = import.meta.env.VITE_HEARDLE_API_URL || "http://localhost:3001"; if (useCache && cachedSongs) { return cachedSongs; } |
