From 3768a2885d58415c057bac70a389533fd4b79b80 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 2 Jan 2018 15:52:11 -0800 Subject: [PATCH] fix examples --- examples/basics/src/main.rs | 3 +-- examples/websocket-chat/src/main.rs | 3 +-- examples/websocket/src/main.rs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/basics/src/main.rs b/examples/basics/src/main.rs index f3f519807..9855fe777 100644 --- a/examples/basics/src/main.rs +++ b/examples/basics/src/main.rs @@ -84,8 +84,7 @@ fn main() { } })) // static files - .resource("/static/{tail:.*}", - |r| r.h(fs::StaticFiles::new("tail", "../static/", true))) + .handler("/static/", fs::StaticFiles::new("tail", "../static/", true)) // redirect .resource("/", |r| r.method(Method::GET).f(|req| { println!("{:?}", req); diff --git a/examples/websocket-chat/src/main.rs b/examples/websocket-chat/src/main.rs index a4d3ce333..baa1e1475 100644 --- a/examples/websocket-chat/src/main.rs +++ b/examples/websocket-chat/src/main.rs @@ -210,8 +210,7 @@ fn main() { // websocket .resource("/ws/", |r| r.route().f(chat_route)) // static resources - .resource("/static/{tail:.*}", - |r| r.h(fs::StaticFiles::new("tail", "static/", true))) + .handler("/static/", fs::StaticFiles::new("static/", true)) }) .bind("127.0.0.1:8080").unwrap() .start(); diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs index dfd0d52c7..fe55e0d83 100644 --- a/examples/websocket/src/main.rs +++ b/examples/websocket/src/main.rs @@ -68,8 +68,7 @@ fn main() { // websocket route .resource("/ws/", |r| r.method(Method::GET).f(ws_index)) // static files - .resource("/{tail:.*}", - |r| r.h(fs::StaticFiles::new("tail", "../static/", true)))) + .handler("/", fs::StaticFiles::new("../static/", true))) // start http server on 127.0.0.1:8080 .bind("127.0.0.1:8080").unwrap() .start();