diff options
author | Teddy Wing | 2017-11-07 01:34:18 +0100 |
---|---|---|
committer | Teddy Wing | 2017-11-07 01:34:18 +0100 |
commit | d15b1f832946a740eb53ba828bdbebd5a7b54fb8 (patch) | |
tree | 8a2fb931373f725c0fe08973ca7f0f77ad29e5b0 /src/main.rs | |
parent | badfb8684f89168d6b596954ebb3dd4d6a000b8c (diff) | |
download | kipper-d15b1f832946a740eb53ba828bdbebd5a7b54fb8.tar.bz2 |
main.rs: Add web server and "hello world" route
Basic web server and dummy response using 'rouille'.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e7a11a9..d5f89ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,15 @@ +#[macro_use] +extern crate rouille; + + fn main() { - println!("Hello, world!"); + rouille::start_server("localhost:8000", move |request| { + router!(request, + (GET) (/) => { + rouille::Response::text("hello world") + }, + + _ => rouille::Response::empty_404() + ) + }); } |