IWS_WS24_clean_architecture/index.html

27 lines
747 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setup Test</title>
</head>
<body>
<h1 id="greetings">Not Working</h1>
<script>
// Fetch Hello World from the FastAPI endpoint
fetch('http://127.0.0.1:8000/greetings')
.then(response => response.json())
.then(data => {
const greetingsContainer = document.getElementById('greetings');
greetingsContainer.innerHTML = '';
data.greetings.forEach(greeting => {
const div = document.createElement('div');
div.textContent = `${greeting[1]}`;
greetingsContainer.appendChild(div);
});
});
</script>
</body>
</html>