#[macro_use] extern crate mime; use iron::prelude::*; use iron::status; use router::Router; mod db; fn init_router() -> Router { let mut router = Router::new(); router.get("/", |_request: &mut Request| { let mut response = Response::new(); response.set_mut(status::Ok); response.set_mut(mime!(Text/Html; Charset=Utf8)); response.set_mut(r#" Rust web server

Hello, world!

"#); Ok(response) }, "root"); router } fn main() { let router = init_router(); Iron::new(router) .http("localhost:8000") .unwrap(); }