First server connection test prototype

This commit is contained in:
2025-11-05 08:47:54 +01:00
parent 12d95f9a4f
commit 80d557715d
2 changed files with 18 additions and 1 deletions

View File

@@ -4,8 +4,9 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PizzaExpress Web</title> <title>PizzaExpress Web</title>
<script src="script.js"></script>
</head> </head>
<body> <body>
<button onclick="orkodyo()">test</button>
</body> </body>
</html> </html>

16
script.js Normal file
View File

@@ -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);
}