From 0a19ee5c338d36a9835a18248deaa2c2c3f98f3d Mon Sep 17 00:00:00 2001 From: CatAClock Date: Tue, 17 Jun 2025 22:54:35 -0700 Subject: [PATCH] favicon --- src/404.html | 1 + src/favicon.ico | Bin 0 -> 761 bytes src/index.html | 1 + src/main.rs | 3 ++- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/favicon.ico diff --git a/src/404.html b/src/404.html index c283fe1..46b0428 100644 --- a/src/404.html +++ b/src/404.html @@ -2,6 +2,7 @@ + Ouch! diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..38e4e573b823af3e612c65c1d0a2d6fde4c8ef62 GIT binary patch literal 761 zcmZ?wbhEHb6krfw_`(1Jj7&^S%*;$IEX*vd%&b7f#=_3QFD7ZME@o|_YGbBpYoX;} zYmgIRnHOa}v(#lymFJvl?^ClPz`6+#ia%L6r!j~yDE{a6a}5c0b_{Se(lcOY1ZvX( zX$3ihf%W?X6W`0&(BzXTMl*fXh@m)7q2zLxpro zh+H7Z0@W$N!_Cdf&d$WZ%*)Hm$Is8f!2t_yHdZcv4t7Kwu(5IR^CP$n3~a1&G8Qn^ Q5SmR+233H80T|ZS09)Q?UH||9 literal 0 HcmV?d00001 diff --git a/src/index.html b/src/index.html index fe442d6..bafeb3e 100644 --- a/src/index.html +++ b/src/index.html @@ -2,6 +2,7 @@ + Hello! diff --git a/src/main.rs b/src/main.rs index a5b42d9..c8202fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,8 @@ use std::fs::File; fn main() { rouille::start_server("127.0.0.1:8080", move |Request| { router!(Request, - (GET) (/) => { Response::from_file("text/html", File::open("src/index.html").unwrap()).with_status_code(200) }, + (GET) ["/"] => { Response::from_file("text/html", File::open("src/index.html").unwrap()).with_status_code(200) }, + (GET) ["/favicon.ico"] => { Response::from_file("image/vnd.microsoft.icon", File::open("src/favicon.ico").unwrap()).with_status_code(200) }, _ => { Response::from_file("text/html", File::open("src/404.html").unwrap()).with_status_code(404) } ) });