aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2017-11-07 01:34:18 +0100
committerTeddy Wing2017-11-07 01:34:18 +0100
commitd15b1f832946a740eb53ba828bdbebd5a7b54fb8 (patch)
tree8a2fb931373f725c0fe08973ca7f0f77ad29e5b0 /src
parentbadfb8684f89168d6b596954ebb3dd4d6a000b8c (diff)
downloadkipper-d15b1f832946a740eb53ba828bdbebd5a7b54fb8.tar.bz2
main.rs: Add web server and "hello world" route
Basic web server and dummy response using 'rouille'.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
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()
+ )
+ });
}