diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2025-12-19 20:26:49 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2025-12-19 20:26:49 +0500 |
| commit | 6d2398cd226c55ec7606f9615046cb55f9774638 (patch) | |
| tree | f23dafa86ea49fc5d8d316662bef75223d0e80c5 /static | |
| parent | daa18bd9eabebe86909e1ad013138774636b3653 (diff) | |
Hotfixes
Diffstat (limited to 'static')
| -rw-r--r-- | static/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/static/index.js b/static/index.js index 991eb6c..0c983a0 100644 --- a/static/index.js +++ b/static/index.js @@ -1,17 +1,19 @@ +const ApiLocation = "/api" let isInfoShown = true; function GetSongs() { - fetch("/api/getSongs").then(r => r.json().then(body => { + fetch(`${ApiLocation}/getSongs`).then(r => r.json().then(body => { console.log(body); })); } function SetRandomSong() { - fetch("/api/randomSong").then(r => r.json().then(body => { + fetch(`${ApiLocation}/randomSong`).then(r => r.json().then(body => { const player = document.getElementById("mainAudio"); console.log(player); console.log(body); - player.src = "/api/getSong?name=" + encodeURI(body.Name); + document.getElementById("Status").innerHTML = "Loading"; + player.src = `${ApiLocation}/getSong?name=${encodeURI(body.Name)}`; document.getElementById("Artist").innerHTML = "Artist: " + body.Meta.Author; document.getElementById("Title").innerHTML = "Title: " + body.Meta.Name; |
