update ws doc

This commit is contained in:
Nikolay Kim 2017-11-29 14:12:27 -08:00
parent ffb2e3c0ab
commit 991dd107b1
2 changed files with 10 additions and 7 deletions

View file

@ -107,12 +107,9 @@ fn main() {
HttpServer::new(
Application::default("/")
// enable logger
.middleware(middlewares::Logger::default())
// websocket route
.resource("/ws/", |r| r.get(|req| ws::start(req, MyWebSocket)))
// static files
.route("/", StaticFiles::new("examples/static/", true)))
.middleware(middlewares::Logger::default()) // <- register logger middleware
.resource("/ws/", |r| r.get(|req| ws::start(req, MyWebSocket))) // <- websocket route
.route("/", StaticFiles::new("examples/static/", true))) // <- server static files
.serve::<_, ()>("127.0.0.1:8080").unwrap();
Arbiter::system().send(msgs::SystemExit(0));