diff options
| author | kanadeko <[email protected]> | 2017-01-17 15:56:44 -0300 |
|---|---|---|
| committer | kanadeko <[email protected]> | 2017-01-17 15:56:44 -0300 |
| commit | 79e786f3b8f261a8c390a661f7e4d90d9b43b713 (patch) | |
| tree | a0ec27f5d9b1d8cbdfec49b19fe70f0a1f3fad06 | |
| parent | Removed extra routes, moved static to main file (diff) | |
| download | host.fuwn.me-79e786f3b8f261a8c390a661f7e4d90d9b43b713.tar.xz host.fuwn.me-79e786f3b8f261a8c390a661f7e4d90d9b43b713.zip | |
Added 500 error page
| -rw-r--r-- | lolisafe.js | 4 | ||||
| -rw-r--r-- | pages/error/500.html | 47 |
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 |