aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lolisafe.js4
-rw-r--r--pages/error/500.html47
2 files changed, 50 insertions, 1 deletions
diff --git a/lolisafe.js b/lolisafe.js
index fffe9a7..91f6de5 100644
--- a/lolisafe.js
+++ b/lolisafe.js
@@ -39,7 +39,9 @@ safe.use(function (req, res, next) {
})
safe.use(function (err, req, res, next) {
- res.status(500).end()
+ res.status(500).sendFile('500.html', {
+ root: './pages/error/',
+ })
})
safe.listen(config.port, () => console.log(`loli-safe started on port ${config.port}`)) \ No newline at end of file
diff --git a/pages/error/500.html b/pages/error/500.html
new file mode 100644
index 0000000..7a21f2e
--- /dev/null
+++ b/pages/error/500.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>loli-safe</title>
+
+ <link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
+
+ <style>
+ html, body {
+ height: 100%;
+ }
+
+ body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ color: #B0BEC5;
+ display: table;
+ font-weight: 100;
+ font-family: 'Lato';
+ }
+
+ .container {
+ text-align: center;
+ display: table-cell;
+ vertical-align: middle;
+ }
+
+ .content {
+ text-align: center;
+ display: inline-block;
+ }
+
+ .title {
+ font-size: 72px;
+ margin-bottom: 40px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="container">
+ <div class="content">
+ <div class="title">Internal server error.</div>
+ </div>
+ </div>
+ </body>
+</html> \ No newline at end of file