aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/html/404.html21
-rw-r--r--src/server.js6
2 files changed, 27 insertions, 0 deletions
diff --git a/src/html/404.html b/src/html/404.html
new file mode 100644
index 0000000..e992326
--- /dev/null
+++ b/src/html/404.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html lang="en">
+
+<head>
+ <title>Mark's Kitchen - Email</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <link rel="stylesheet" type="text/css" href="/css/styles.css">
+</head>
+
+<body>
+ <div>
+ <h1>
+ <a class="navigation" href="/" title="marks.kitchen">&lt;</a>
+ 404 Error
+ </h1>
+ <p>That page doesn't seem to exist...</p>
+ </div>
+</body>
+
+</html> \ No newline at end of file
diff --git a/src/server.js b/src/server.js
index d254722..7be1237 100644
--- a/src/server.js
+++ b/src/server.js
@@ -388,6 +388,12 @@ function setUpRoutes(models, jwtFunctions, database) {
res.setHeader('Content-Type', 'text/xml')
res.status(200).send(feed.xml({indent: true}))
})
+
+ // Final 404 fallback
+ server.use(function(req, res) {
+ res.status(400);
+ res.sendFile(__dirname + "/html/404.html");
+ });
}
module.exports = {