added 404 page

This commit is contained in:
2024-05-21 15:13:24 -07:00
parent 001114251e
commit a40bd2ae72
2 changed files with 56 additions and 1 deletions

54
404.html Normal file
View File

@ -0,0 +1,54 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<style>
:root {
--foreground: #ffffff;
--background: #000000;
--accent-50: #adadad;
}
@media (prefers-color-scheme: light) {
:root {
--foreground: #000000;
--background: #ffffff;
--accent-50: #525252;
}
}
body {
display: flex;
flex-direction: column;
margin: 0;
justify-content: center;
align-items: center;
min-height: 100vh;
}
body {
background: var(--background);
font-family: "Roboto", sans-serif;
color: var(--foreground);
h1 {
margin: 0;
}
h3 {
margin: 0;
color: var(--accent-50);
}
}
</style>
</head>
<body>
<h1>404</h1>
<h3>Page Not Found</h3>
</body>
</html>

View File

@ -32,7 +32,8 @@
(. _G.files uri) (. _G.files uri)
(utils.file-exists? uri) (with-open [file (io.open uri :r)]
(file:read :*a))
"404 - Not Found"))
(with-open [file (io.open :404.html :r)]
(file:read :*a))))
(client:send "HTTP/1.1 200 OK\r\n\r\n")
(client:send content)