From 84d8e87929783ce7a53d00f40c633b8614b14d73 Mon Sep 17 00:00:00 2001
From: James Arcus <jimbo@ucc.asn.au>
Date: Thu, 26 Sep 2024 22:38:42 +0800
Subject: [PATCH] Move images to static folder

---
 door_closed.html                       |   2 +-
 door_open.html                         |   2 +-
 main.js                                |   8 ++++----
 door.jpg => static/door_ucc_closed.jpg | Bin
 gary.jpg => static/door_ucc_open.jpg   | Bin
 5 files changed, 6 insertions(+), 6 deletions(-)
 rename door.jpg => static/door_ucc_closed.jpg (100%)
 rename gary.jpg => static/door_ucc_open.jpg (100%)

diff --git a/door_closed.html b/door_closed.html
index b74178a..1ad1f17 100644
--- a/door_closed.html
+++ b/door_closed.html
@@ -8,7 +8,7 @@
     <h1>UCC Door Status</h1>
     <p>The door is currently closed.</p>
     <img
-      src="/door.jpg"
+      src="/static/door_ucc_closed.jpg"
       width="574"
       height="1020"
       alt="A plain image of the UCC door. Surely nothing sinister lies within..."
diff --git a/door_open.html b/door_open.html
index db5e592..33695ed 100644
--- a/door_open.html
+++ b/door_open.html
@@ -9,7 +9,7 @@
     <p>The door is currently open!</p>
     <p>Opened by: <span id="opener"></span></p>
     <img
-      src="/gary.jpg"
+      src="/static/door_ucc_open.jpg"
       width="574"
       height="1020"
       alt="A wild Gary lurking in the open doorway to the UCC clubroom."
diff --git a/main.js b/main.js
index 0183b4e..c7234be 100644
--- a/main.js
+++ b/main.js
@@ -108,12 +108,12 @@ const server = http.createServer((req, res) => {
     return send_json(res, 200, doorState ? doorOpener : null);
   }
 
-  if (req.url === '/gary.jpg') {
-    return send_file(res, 200, './gary.jpg', 'image/jpeg');
+  if (req.url === '/static/door_ucc_open.jpg') {
+    return send_file(res, 200, './static/door_ucc_open.jpg', 'image/jpeg');
   }
 
-  if (req.url === '/door.jpg') {
-    return send_file(res, 200, './door.jpg', 'image/jpeg');
+  if (req.url === '/static/door_ucc_closed.jpg') {
+    return send_file(res, 200, './static/door_ucc_closed.jpg', 'image/jpeg');
   }
 
   return send_error(res, 404);
diff --git a/door.jpg b/static/door_ucc_closed.jpg
similarity index 100%
rename from door.jpg
rename to static/door_ucc_closed.jpg
diff --git a/gary.jpg b/static/door_ucc_open.jpg
similarity index 100%
rename from gary.jpg
rename to static/door_ucc_open.jpg
-- 
GitLab