diff options
author | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 10:05:14 +0200 |
---|---|---|
committer | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 10:05:14 +0200 |
commit | 95e66b3b4779c8b2a4f3d19c8973bcd82f92b545 (patch) | |
tree | 32781d8e1b9ff7aec99248d4937718c6b19c428f /app.js | |
parent | 404 (diff) |
404
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -43,10 +43,20 @@ app.get('/', function(req, res) { app.get('*', function(req, res) { console.log("404 - " + req.url); - fs.readFile('public/404.html', 'utf8', function(err, data) { + fs.readFile('public/404.md', 'utf8', function(err, data) { if (err) return console.log(err); - res.status(404).send(data); + fs.readFile('public/css/style.css', 'utf8', function(err, style) { + var html = '<html>'; + html += '<head>'; + html += '<style>' + style + '</style>'; + html += '</head>'; + html += '<body class=\'markdown-preview\' data-use-github-style>'; + html += converter.makeHtml(data); + html += '</body>'; + html += '</html>'; + res.status(404).send(html); + }); }); }); |