1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +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

@ -24,8 +24,9 @@ fn index(query: Query<HashMap<String, String>>) -> Result<HttpResponse> {
UserTemplate {
name: name,
text: "Welcome!",
}.render()
.unwrap()
}
.render()
.unwrap()
} else {
Index.render().unwrap()
};
@ -38,9 +39,10 @@ fn main() {
// start http server
server::new(move || {
App::new().resource("/", |r| r.method(http::Method::GET).with(index))
}).bind("127.0.0.1:8080")
.unwrap()
.start();
})
.bind("127.0.0.1:8080")
.unwrap()
.start();
println!("Started http server: 127.0.0.1:8080");
let _ = sys.run();