Initial commit

This commit is contained in:
2025-02-17 22:31:56 +01:00
commit db233f38a3
18 changed files with 706 additions and 0 deletions

31
templates/index.html Normal file
View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>Frasi</title>
<script>
function fetchData(){
fetch("/get_phrases")
.then(response => response.json())
.then(data =>{
let container = document.getElementById("content");
container.innerHTML = "";
data.forEach(line => {
let p = document.createElement("p");
p.textContent = line;
container.appendChild(p);
});
})
.catch(error => console.error("Error fetching data:", error));
}
setInterval(fetchData, 2000);
window.onload = fetchData;
</script>
</head>
<body>
<h1>Frasi</h1>
<div id="content"></div>
<br>
<a href="/input">Inserisci una frase</a>
</body>
</html>

10
templates/input.html Normal file
View File

@@ -0,0 +1,10 @@
<html>
<body>
<form action = "/input" method = "post">
<p>Inserisci frase:</p>
<p><input type = "text" name = "nm" /></p>
<p><input type = "submit" value = "submit" /></p>
</form>
</body>
</html>