diff --git a/podman-commands b/podman-commands index 5195d60..98f7e5d 100644 --- a/podman-commands +++ b/podman-commands @@ -1,8 +1,8 @@ podman build --tag alipricetrack:1.0.0 -f ./Dockerfile -podman pod create --name aliexpress -p 8080:8080 +podman pod create --name aliexpress -p 8086:8080 -podman run -d --pod=aliexpress -e POSTGRES_DB="aliexpress" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" -v /home/fire/Downloads/db:/var/lib/postgresql/data --name ali-db docker.io/postgres +podman run -d --pod=aliexpress -e POSTGRES_DB="aliexpress" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" -v /home/data/podman/aliexpress/db:/var/lib/postgresql/data:Z --name ali-db docker.io/postgres podman run -d --pod=aliexpress -e POSTGRES_DB="aliexpress" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" --name ali-app alipricetrack:1.0.0 diff --git a/web/app.html b/web/app.html index 4afb6c5..3cffd63 100644 --- a/web/app.html +++ b/web/app.html @@ -7,4 +7,10 @@
- + + diff --git a/web/app.js b/web/app.js index 1122098..1a863eb 100644 --- a/web/app.js +++ b/web/app.js @@ -11,6 +11,10 @@ const margin = { // get window width const width = window.innerWidth - margin.right - margin.left -10; +// url +const currentUrl = window.location.href; +console.log(currentUrl); + // reload page when window is resized // (resizes every elements) @@ -18,7 +22,7 @@ window.onresize = function(){ location.reload(); } async function fetch_history() { try { - const response = await fetch('http://127.0.0.1:8080/datahistory'); + const response = await fetch(`${currentUrl}/datahistory`); const rawData = await response.json(); // SELECT uuid, quantity, discount_percentage, price, currency, h_timestamp let historyData = rawData.map(d => ({ @@ -37,7 +41,7 @@ async function fetch_history() { async function fetch_item() { try { // SELECT uuid, itemid, skuid, choice, attributes, image - const response = await fetch('http://127.0.0.1:8080/dataitem'); + const response = await fetch(`${currentUrl}/dataitem`); const rawData = await response.json(); const items = rawData.reduce((item, row) => { const uuid = row[0];