First server connection test prototype
This commit is contained in:
16
script.js
Normal file
16
script.js
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user