From a40bd2ae7265cdcb0f422d8f2a198f2a5a6a939d Mon Sep 17 00:00:00 2001 From: Winter Hille Date: Tue, 21 May 2024 15:13:24 -0700 Subject: [PATCH] added 404 page --- 404.html | 54 ++++++++++++++++++++++++++++++++++++++++++++++ client-handler.fnl | 3 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 404.html diff --git a/404.html b/404.html new file mode 100644 index 0000000..b51a05d --- /dev/null +++ b/404.html @@ -0,0 +1,54 @@ + + + + + + + + + +

404

+

Page Not Found

+ + + diff --git a/client-handler.fnl b/client-handler.fnl index dd5aac3..047a809 100644 --- a/client-handler.fnl +++ b/client-handler.fnl @@ -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)