From c66a8ae60e3ca0b2e2014c98fe4dcf2e1eb32220 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Fri, 20 Jun 2025 19:26:04 -0700 Subject: [PATCH] SQL database is now accessable. CSS and JS implemented --- src/HTTP/index.html | 6 +++++- src/HTTP/style.css | 8 ++++++-- src/index.html | 17 ----------------- src/main.rs | 6 ++++++ 4 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 src/index.html diff --git a/src/HTTP/index.html b/src/HTTP/index.html index 306ad62..b8ec892 100644 --- a/src/HTTP/index.html +++ b/src/HTTP/index.html @@ -3,11 +3,15 @@ - Hello! + + Main

Hello!

Hi from Rust.

View your profile. + + + diff --git a/src/HTTP/style.css b/src/HTTP/style.css index 91307bd..5f1a1d2 100644 --- a/src/HTTP/style.css +++ b/src/HTTP/style.css @@ -1,9 +1,13 @@ body { - text-align: center + text-align: center; + justify-content: center; } h1 { - font-size: 10% + font-size: 8ch; + + margin-top: 0; + margin-bottom: 0; } p { diff --git a/src/index.html b/src/index.html deleted file mode 100644 index b8ec892..0000000 --- a/src/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Main - - -

Hello!

-

Hi from Rust.

- View your profile. - - - - - diff --git a/src/main.rs b/src/main.rs index e1b7842..a188a1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,12 @@ fn main(){ (GET) ["/favicon.ico"] => { Response::from_file("image/vnd.microsoft.icon", File::open("src/HTTP/favicon.ico").unwrap()).with_status_code(200) }, + (GET) ["/style.css"] => { + Response::from_file("text/css", File::open("src/HTTP/style.css").unwrap()).with_status_code(200) + }, + (GET) ["/script.js"] => { + Response::from_file("text/javascript", File::open("src/HTTP/script.js").unwrap()).with_status_code(200) + }, // Catch-all. Fuck you. _ => { Response::from_file("text/html", File::open("src/HTTP/404.html").unwrap()).with_status_code(404)