23 lines
615 B
HTML
Raw Normal View History

2023-03-24 09:09:36 +01:00
<html>
<h1>List of teams:</h1>
<div id="teams"></div>
<script>
const teamsDiv = document.getElementById('teams');
function fetchTeams() {
2023-03-24 10:36:36 +01:00
fetch('http://127.0.0.1:9090/api/teams')
2023-03-24 09:09:36 +01:00
.then((response) => {
response.json()
.then((teams) => {
2023-03-24 10:36:36 +01:00
let div = "";
teams.forEach((t) => {
div += `<div>Equipe ID${t.id} - Nom d'équipe ${t.team}</div>\n`
})
teamsDiv.innerHTML = div;
2023-03-24 09:09:36 +01:00
})
}).catch(error => console.error);
}
fetchTeams();
</script>
</html>