extern crate iron; extern crate rusty_pipe; use iron::Handler; use iron::status; use iron::IronResult; use iron::Response; use iron::Request; use iron::Iron; use rusty_pipe::Router; struct MessageHandler { message: String } impl Handler for MessageHandler { fn handle(&self, _: &mut Request) -> IronResult { Ok(Response::with((status::Ok, self.message.clone()))) } } fn main() { let handler = MessageHandler { message: "You've found the index page!".to_string() }; let mut router = Router::new(); router.get("/", handler, "index"); Iron::new(router).http("localhost:3000").unwrap(); }