]> git.cworth.org Git - zombocom-ai/commitdiff
Add a simple express server
authorCarl Worth <cworth@cworth.org>
Wed, 7 Dec 2022 00:36:53 +0000 (16:36 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 7 Dec 2022 00:36:53 +0000 (16:36 -0800)
And an HTML file for it to serve, (copied in from the zombocom-static
repository I made earlier today).

index.html [new file with mode: 0644]
index.js [new file with mode: 0644]

diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..d82fb66
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>ZOMBO</title>
+  <link href="/zombo.css" rel="stylesheet" type="text/css">
+  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <meta name="HandheldFriendly" content="true">
+</head>
+
+<body>
+  <div align="center">
+    <p>
+      <br>
+    </p>
+
+    <p>
+      <img src="/zombocom.png" alt="Zombocom" longdesc="http://zombo.com" width="1199" height="217">
+    </p>
+  </div>
+
+  <div align="center">
+   <div class="animate-flicker">
+     <p>
+       <img src="/pngwheel.png" class="rotate thefade">
+     </p>
+   </div>
+  </div>
+
+  <audio loop="" src="/zombo_words.mp3" type="audio/mpeg"></audio>
+  <button id="button" class="fade">
+    <div>🔊</div>
+    <script>
+const button = document.querySelector("#button");
+const icon = document.querySelector("#button > div");
+const audio = document.querySelector("audio");
+
+button.addEventListener("click", () => {
+  if (audio.paused) {
+      audio.volume = 0.2;
+      audio.play();
+      icon.innerHTML = "🔈";
+  } else {
+      audio.pause();
+      icon.innerHTML = "🔊";
+  }
+  button.classList.add("fade");
+});
+    </script>
+
+  </button>
+</body>
+</html>
diff --git a/index.js b/index.js
new file mode 100644 (file)
index 0000000..1903531
--- /dev/null
+++ b/index.js
@@ -0,0 +1,14 @@
+const express = require('express');
+const app = express();
+const http = require('http');
+const server = http.createServer(app);
+const port = 2122;
+
+app.get('/', (req, res) => {
+    res.sendFile(__dirname + '/index.html');
+});
+
+server.listen(port, () => {
+    console.log(`listening on *:${port}`);
+});
+