From 61651a9a02da9110bfd2e441aa4600e4c943bbc9 Mon Sep 17 00:00:00 2001 From: "ishak jmilou.ishak" Date: Wed, 18 Dec 2024 12:22:22 +0100 Subject: [PATCH] try to see why sensor value doesnt show on website --- src/Python/flask/web/static/script.js | 3 +++ src/Python/wsgi.py | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 src/Python/wsgi.py diff --git a/src/Python/flask/web/static/script.js b/src/Python/flask/web/static/script.js index db8cd8c..cdd56e4 100644 --- a/src/Python/flask/web/static/script.js +++ b/src/Python/flask/web/static/script.js @@ -25,9 +25,12 @@ document.addEventListener("DOMContentLoaded", function() { // Fetch data from the server async function fetchData() { + try{ const response = await fetch("/data"); const data = await response.json(); return data; + } catch (error) { + console.error("Error:", error); } // Parse the data and show it on the website diff --git a/src/Python/wsgi.py b/src/Python/wsgi.py deleted file mode 100644 index ec77ef1..0000000 --- a/src/Python/wsgi.py +++ /dev/null @@ -1,7 +0,0 @@ -import sys -import logging - -logging.basicConfig(stream=sys.stderr) -sys.path.insert(0, "/home/ishak/rooziinuubii79/src/Python/flask/web") - -from app import app as application \ No newline at end of file