const apiUrl = "http://localhost:5011"; function orkodyo(){ let reply; const requestOptions = { method: "GET", redirect: "follow" }; fetch(apiUrl + "/api/pizze", requestOptions) .then((response) => response.text()) .then((result) => alert(result)) .catch((error) => console.error(error)); } function listPizze(){ let reply; const requestOptions = { method: "GET", redirect: "follow" }; fetch(apiUrl + "/api/pizze", requestOptions) .then((response) => response.json()) .then((pizze) => { // Creiamo la tabella let table = '
| ID | Nome | Prezzo |
|---|---|---|
| ${pizza.id} | ${pizza.nome} | ${pizza.prezzo}€ |