-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
32 lines (32 loc) · 822 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<body>
<a href="https://app-service-thibault-boulay.azurewebsites.net">API</a>
<h1>Liste des produits</h1>
<table id="data-table">
<tr>
<th>Id</th>
<th>Nom</th>
<th>Description</th>
<th>Prix</th>
</tr>
</table>
<script>
const table = document.querySelector("#data-table");
fetch("https://app-service-thibault-boulay.azurewebsites.net")
.then(response => response.json())
.then(actors => {
actors.forEach(actor => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${actor.Id}</td>
<td>${actor.Name}</td>
<td>${actor.Desc}</td>
<td>${actor.Prix}</td>
`;
table.appendChild(row);
});
});
</script>
</body>
</html>