2023-03-24 09:09:36 +01:00

22 lines
610 B
HTML

<html>
<h1>List of teams:</h1>
<div id="teams"></div>
<script>
const teamsDiv = document.getElementById('teams');
function fetchTeams() {
fetch('http://127.0.0.1:9090/equipes')
.then((response) => {
response.json()
.then((teams) => {
const mmoContent = teams.equipes.map((team) =>
`<div>${team.name} - ${team.id}</div>`
).join('');
teamsDiv.innerHTML = mmoContent;
})
}).catch(error => console.error);
}
fetchTeams();
</script>
</html>