Use container_name for API endpoint

This commit is contained in:
Andrea Fazzi 2021-11-03 10:12:09 +01:00
parent eab0a3468c
commit 0217e1047c

View file

@ -11,7 +11,7 @@
let download_path = "#";
async function startDownload() {
const res = await fetch(`http://localhost:8080/download?url=${url}`);
const res = await fetch(`http://yt-dls-backend:8080/download?url=${url}`);
video_info = await res.json();
if (res.ok) {
@ -23,12 +23,12 @@
}
async function getStatus() {
const res = await fetch(`http://localhost:8080/status?url=${url}`);
const res = await fetch(`http://yt-dls-backend:8080/status?url=${url}`);
status = await res.json();
if (res.ok) {
if (status.DownloadPath) {
download_path = `http://localhost:8080/${status.DownloadPath}`;
download_path = `http://yt-dls-backend:8080/${status.DownloadPath}`;
}
return status;
} else {