aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr>2017-09-27 10:05:14 +0200
committerArnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr>2017-09-27 10:05:14 +0200
commit95e66b3b4779c8b2a4f3d19c8973bcd82f92b545 (patch)
tree32781d8e1b9ff7aec99248d4937718c6b19c428f
parent404 (diff)
404
-rw-r--r--app.js14
-rw-r--r--public/404.html21
-rw-r--r--public/404.md4
3 files changed, 16 insertions, 23 deletions
diff --git a/app.js b/app.js
index 4ad24b0..408004c 100644
--- a/app.js
+++ b/app.js
@@ -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);
+ });
});
});
diff --git a/public/404.html b/public/404.html
deleted file mode 100644
index 2b40c91..0000000
--- a/public/404.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <meta charset="utf-8" />
- <title>404 - RSC</title>
-
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
- <link rel="stylesheet" type="text/css" href="css/style.css">
-</head>
-
-<body class='markdown-preview' data-use-github-style>
- <div>
- <div class="row">
- <h1>404</h1>
- <p>Teapot not found</p>
- </div>
- </div>
-</body>
-
-</html>
diff --git a/public/404.md b/public/404.md
new file mode 100644
index 0000000..5367983
--- /dev/null
+++ b/public/404.md
@@ -0,0 +1,4 @@
+# 404
+## Teapot not found
+
+The page you are looking for does not exists