fix(server): Make sleep_on_errors configurable and use it in example

This commit is contained in:
Klaus Purer
2018-02-24 16:19:01 +01:00
parent 68458cde57
commit 3a36eb5596
2 changed files with 14 additions and 4 deletions

View File

@@ -19,7 +19,10 @@ fn main() {
.with_body(PHRASE))
}));
let server = Http::new().bind(&addr, new_service).unwrap();
let server = Http::new()
.sleep_on_errors(true)
.bind(&addr, new_service)
.unwrap();
println!("Listening on http://{} with 1 thread.", server.local_addr().unwrap());
server.run().unwrap();
}