From 5f0477ca8dcb158fa84d98f41a62a304d9310984 Mon Sep 17 00:00:00 2001 From: sweatshirt0 Date: Mon, 20 Feb 2023 14:58:44 -0500 Subject: [PATCH] news and about page creation; minor css changes. --- pages/about.html | 23 +++++++++++++++++++++++ pages/home.html | 10 +++++++--- pages/news.html | 23 +++++++++++++++++++++++ server.js | 30 ++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 pages/about.html create mode 100644 pages/news.html diff --git a/pages/about.html b/pages/about.html new file mode 100644 index 0000000..472a7ed --- /dev/null +++ b/pages/about.html @@ -0,0 +1,23 @@ + + + + + About + + + +
+ +
+

About Us.

+
+
+

We are a streaming service that emphasises the freedom of all it's users -- viewers and streamers alike.

+
+
+ + diff --git a/pages/home.html b/pages/home.html index 9b1eae1..d550bf1 100644 --- a/pages/home.html +++ b/pages/home.html @@ -7,9 +7,13 @@
-

Logged in.

- Back home - Log Out + +
+

You are now logged in.

+
diff --git a/pages/news.html b/pages/news.html new file mode 100644 index 0000000..ed88634 --- /dev/null +++ b/pages/news.html @@ -0,0 +1,23 @@ + + + + + Anarchy News + + + +
+ +
+

News

+
+
+

No news so far...

+
+
+ + diff --git a/server.js b/server.js index f597891..61d7898 100644 --- a/server.js +++ b/server.js @@ -88,6 +88,36 @@ const server = http.createServer((req, res) => { }); } + if (req.url === "/about") { + res.statusCode = 200; + res.setHeader("Content-Type", "text/html"); + fs.readFile("pages/about.html", (error, data) => { + if (error) { + res.writeHead(404); + res.write("Error: File not found."); + } else { + res.write(data); + } + + res.end(); + }); + } + + if (req.url === "/news") { + res.statusCode = 200; + res.setHeader("Content-Type", "text/html"); + fs.readFile("pages/news.html", (error, data) => { + if (error) { + res.writeHead(404); + res.write("Error: File not found."); + } else { + res.write(data); + } + + res.end(); + }); + } + if (req.url === "/members" && req.method === "POST") { res.statusCode = 200; //res.setHeader("Content-Type", "text/json");