From 80d557715dd037eade2d2dcc81e189bdf7243ee0 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 5 Nov 2025 08:47:54 +0100 Subject: [PATCH] First server connection test prototype --- index.html | 3 ++- script.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 script.js diff --git a/index.html b/index.html index 5143322..573aef0 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,9 @@ PizzaExpress Web + - + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..6977e24 --- /dev/null +++ b/script.js @@ -0,0 +1,16 @@ +const apiUrl = "https://localhost:7243"; + +function orkodyo(){ + let reply; + const requestOptions = { + method: "GET", + redirect: "follow" + }; + + fetch(apiUrl + "/api/pizze", requestOptions) + .then((response) => reply = response.text()) + .then((result) => console.log(result)) + .catch((error) => console.error(error)); + + alert(reply); +}