mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
update ws doc
This commit is contained in:
parent
ffb2e3c0ab
commit
991dd107b1
2 changed files with 10 additions and 7 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue