diff --git a/src/index.html b/src/index.html index bafeb3e..306ad62 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,7 @@

Hello!

-

Hi from Rust

+

Hi from Rust.

+ View your profile. diff --git a/src/main.rs b/src/main.rs index c8202fa..487c782 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,9 +6,13 @@ use std::fs::File; fn main() { rouille::start_server("127.0.0.1:8080", move |Request| { + // Router. Go to the correct pages, else hit the sack. router!(Request, (GET) ["/"] => { Response::from_file("text/html", File::open("src/index.html").unwrap()).with_status_code(200) }, + (GET) ["/Profile"] => { Response::from_file("text/html", File::open("src/profile.html").unwrap()).with_status_code(200) }, + // Get specific images. Because the browser said so. (GET) ["/favicon.ico"] => { Response::from_file("image/vnd.microsoft.icon", File::open("src/favicon.ico").unwrap()).with_status_code(200) }, + // Catch-all. Fuck you. _ => { Response::from_file("text/html", File::open("src/404.html").unwrap()).with_status_code(404) } ) }); diff --git a/src/profile.html b/src/profile.html new file mode 100644 index 0000000..ccec8d4 --- /dev/null +++ b/src/profile.html @@ -0,0 +1,12 @@ + + + + + + Hello! + + +

Profile!

+

This is totally your profile girl.

+ +