whatcanGOwrongagain

This commit is contained in:
2024-09-19 21:45:28 -04:00
parent d0ae4d841d
commit 49fc107a14
3 changed files with 50 additions and 67 deletions
+23 -12
View File
@@ -1,17 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/home/ilyes/LearnGO/firstApp/style.css" />
<title>Dad Jokes</title>
</head>
<body>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Go Server Hello</title>
<!-- Link to the external CSS file -->
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<div class="container">
<h3>Don't Laugh Challenge</h3>
<div id="joke" class="joke">// Joke goes here</div>
<button id="jokeBtn" class="btn">Get Another Joke</button>
<h1>Hello from Go Server</h1>
<p>The current time is: <span id="time"></span></p>
</div>
<script src="script.js"></script>
</body>
<script>
// Fetch current time from the /time endpoint
fetch('/time')
.then(response => response.text())
.then(time => {
document.getElementById('time').textContent = time;
});
</script>
</body>
</html>