From c3c46a72099b1772d0c955a2b9b816c7da9d3b42 Mon Sep 17 00:00:00 2001 From: daniele Date: Tue, 24 Jun 2025 08:52:30 +0000 Subject: [PATCH] Upload files to "js" --- js/fermata.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/fermata.js b/js/fermata.js index c3b8e66..62a029e 100644 --- a/js/fermata.js +++ b/js/fermata.js @@ -5,9 +5,10 @@ const selectedOption = params.get('selectedOption'); console.log(palina, targetID, selectedOption); // Esempio URL backend che ritorna JSON { linea, destinazione, veicolo, soppressa } -const urlBackend = `http://URL-API/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`; +const urlBackend = `https://api.vichingo455.freeddns.org/start-fermatebus.json/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`; -fetch(urlBackend) +function caricadati(){ + fetch(urlBackend) .then(res => res.json()) .then(data => { const container = document.getElementById('tabella-container'); @@ -55,4 +56,9 @@ fetch(urlBackend) .catch(err => { console.error('Errore nel caricamento dati:', err); document.getElementById('tabella-container').textContent = 'Errore nel caricamento dati.'; - }); \ No newline at end of file + }); +} + +caricadati(); + +setInterval(caricadati, 60000); \ No newline at end of file