1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

update more examples and rustfmt

This commit is contained in:
Nikolay Kim
2019-03-09 18:03:09 -08:00
parent f39a53ea3a
commit e2945b9b39
48 changed files with 485 additions and 801 deletions

View File

@ -101,14 +101,16 @@ fn main() {
server::new(|| {
App::with_state(AppState {
counter: Cell::new(0),
}).middleware(middleware::Logger::default())
.resource("/", |r| {
r.method(http::Method::GET).with(index);
r.method(http::Method::POST).with(upload);
})
}).bind("127.0.0.1:8080")
.unwrap()
.start();
})
.middleware(middleware::Logger::default())
.resource("/", |r| {
r.method(http::Method::GET).with(index);
r.method(http::Method::POST).with(upload);
})
})
.bind("127.0.0.1:8080")
.unwrap()
.start();
println!("Starting http server: 127.0.0.1:8080");
let _ = sys.run();