From 4a2d7311cef683a66f77b81d9fb1f4c53e4ca01d Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 27 Sep 2017 10:02:40 +0200 Subject: 404 --- app.js | 7 ++++++- public/404.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index e4a1c71..4ad24b0 100644 --- a/app.js +++ b/app.js @@ -42,7 +42,12 @@ app.get('/', function(req, res) { }); app.get('*', function(req, res) { - res.status(404).send('Are you a teapot ?'); + console.log("404 - " + req.url); + fs.readFile('public/404.html', 'utf8', function(err, data) { + if (err) + return console.log(err); + res.status(404).send(data); + }); }); var server = app.listen(80, function() { diff --git a/public/404.html b/public/404.html index b73acb6..2b40c91 100644 --- a/public/404.html +++ b/public/404.html @@ -13,7 +13,7 @@

404

-

Teapot not found

+

Teapot not found

-- cgit v1.2.3