mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
renamed Route::handler to Route::f, added Route::h to register Handler
This commit is contained in:
parent
03f7d95d88
commit
f5d6179a34
19 changed files with 79 additions and 40 deletions
|
@ -108,8 +108,8 @@ fn main() {
|
|||
HttpServer::new(
|
||||
Application::default("/")
|
||||
.middleware(middlewares::Logger::default()) // <- register logger middleware
|
||||
.resource("/ws/", |r| r.method(Method::GET)
|
||||
.handler(|req| ws::start(req, MyWebSocket))) // <- websocket route
|
||||
.resource("/ws/", |r|
|
||||
r.method(Method::GET).f(|req| ws::start(req, MyWebSocket))) // <- websocket route
|
||||
.route("/", fs::StaticFiles::new("examples/static/", true))) // <- serve static files
|
||||
.serve::<_, ()>("127.0.0.1:8080").unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue