-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetErrorPage.js
More file actions
66 lines (58 loc) · 2.38 KB
/
getErrorPage.js
File metadata and controls
66 lines (58 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const getGif = (code) => code === 404 ? '/missing.gif' : '/help.gif'
module.exports = (code, url) => {
const gif = getGif(code)
return `
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel='shortcut icon' href='/favicon.png'>
<link rel='shortcut icon' href='/favicon.png'>
<title>Error ${code}</title>
<meta name='description' content='A huge collection of technology-related files containing whatever knowledge you need, whenever you need it.'>
<meta name='image' content='https://asmodeus.pensquid.net/favicon.png'>
<meta itemprop='name' content='Asmodeus - Error ${code}'>
<meta itemprop='description' content='A huge collection of technology-related files containing whatever knowledge you need, whenever you need it.'>
<meta itemprop='image' content='https://asmodeus.pensquid.net/favicon.png'>
<meta name='twitter:card' content='summary'>
<meta name='twitter:title' content='Error ${code}'>
<meta name='twitter:description' content='A huge collection of technology-related files containing whatever knowledge you need, whenever you need it.'>
<meta name='twitter:image:src' content='https://asmodeus.pensquid.net/favicon.png'>
<meta name='og:title' content='Error ${code}'>
<meta name='og:description' content='A huge collection of technology-related files containing whatever knowledge you need, whenever you need it.'>
<meta name='og:image' content='https://asmodeus.pensquid.net/favicon.png'>
<meta name='og:url' content='https://asmodeus.pensquid.net${url}'>
<meta name='og:site_name' content='Asmodeus'>
<meta name='og:locale' content='en_US'>
<meta name='og:type' content='website'>
<style>
@import url('https://fonts.googleapis.com/css?family=Overpass+Mono:700&display=swap');
body {
margin: 0;
font-family: 'Overpass Mono', monospace;
background: #000000;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
text-align: center;
}
h1 {
font-size: 3rem;
}
img {
width: 100%;
max-width: 800px;
}
</style>
</head>
<body>
<h1>${code}</h1>
<img src='${gif}' alt='Error ${code}'>
</body>
</html>
`
}