1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 18:09:22 +02:00

update examples

This commit is contained in:
Nikolay Kim
2017-12-18 13:06:41 -08:00
parent 27d92f3a23
commit 9ed4159c0c
5 changed files with 13 additions and 14 deletions

View File

@ -42,7 +42,8 @@ fn main() {
.header("LOCATION", "/index.html")
.body(Body::Empty)
})))
.serve_ssl::<_, ()>("127.0.0.1:8443", &pkcs12).unwrap();
.bind("127.0.0.1:8443").unwrap()
.start_ssl(&pkcs12).unwrap();
println!("Started http server: 127.0.0.1:8443");
let _ = sys.run();

View File

@ -207,13 +207,14 @@ fn main() {
.header("LOCATION", "/static/websocket.html")
.body(Body::Empty)
}))
// websocket
// websocket
.resource("/ws/", |r| r.route().f(chat_route))
// static resources
// static resources
.resource("/static/{tail:.*}",
|r| r.h(fs::StaticFiles::new("tail", "static/", true)))
})
.serve::<_, ()>("127.0.0.1:8080").unwrap();
.bind("127.0.0.1:8080").unwrap()
.start().unwrap();
let _ = sys.run();
}