Skip to content

Instantly share code, notes, and snippets.

@muja
Created July 26, 2015 02:46
Show Gist options
  • Save muja/7f0b281287dd506980b5 to your computer and use it in GitHub Desktop.
Save muja/7f0b281287dd506980b5 to your computer and use it in GitHub Desktop.
struct X {
counter: u32
}
impl X {
fn handler(&self, _: &mut Request) -> IronResult<Response> {
self.counter += 1;
Ok(Response::with((iron::status::Ok, "Hello World")))
}
}
fn main() {
let x = X::new();
Iron::new(x.handler).http("localhost:9666").unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment