1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 01:51:23 +02:00

cleanup examples

This commit is contained in:
Nikolay Kim
2017-12-20 16:32:31 -08:00
parent 4dd3382ac7
commit 3c5fd18e02
5 changed files with 18 additions and 17 deletions

View File

@ -200,12 +200,12 @@ fn main() {
let state = WsChatSessionState { addr: server.clone() };
Application::with_state(state)
// redirect to websocket.html
.resource("/", |r| r.method(Method::GET).f(|req| {
// redirect to websocket.html
.resource("/", |r| r.method(Method::GET).f(|_| {
httpcodes::HTTPFound
.build()
.header("LOCATION", "/static/websocket.html")
.body(Body::Empty)
.finish()
}))
// websocket
.resource("/ws/", |r| r.route().f(chat_route))