From 900f96e42d8d37cc2e7c582e285ed0a29c15602b Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 13 Aug 2020 13:46:25 -0500 Subject: Add 404 page --- src/html/404.html | 21 +++++++++++++++++++++ src/server.js | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 src/html/404.html (limited to 'src') 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 @@ + + + + + Mark's Kitchen - Email + + + + + + +
+

+ < + 404 Error +

+

That page doesn't seem to exist...

+
+ + + \ 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 = { -- cgit v1.2.3