I have a super simple web server, and for some reason the println! statement is printed out twice. Why could this be?
extern crate iron;
use iron::prelude::*;
use iron::status;
fn hello_world(_: &mut Request) -> IronResult<Response> {
println!("Said Hello World");
Ok(Response::with((status::Ok, "Hello World\n")))
}
fn main() {
Iron::new(hello_world).http("localhost:8000").unwrap();
}
Every time I refresh my browser the output in the shell is:
Said Hello World
Said Hello World
I would only expect the line to be printed out once.It seems that my hello_world functions is being called twice. What am I missing?