Initial commit
This commit is contained in:
31
templates/index.html
Normal file
31
templates/index.html
Normal 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
10
templates/input.html
Normal 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>
|
||||
|
||||
Reference in New Issue
Block a user