mirror of
https://github.com/actix/actix-web.git
synced 2024-12-17 13:46:36 +00:00
update readme example
This commit is contained in:
parent
97e2bcd055
commit
a5a36ff194
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ Actix web is a simple, pragmatic, extremely fast, web framework for Rust.
|
|||
|
||||
```rust
|
||||
extern crate actix_web;
|
||||
use actix_web::{Application, HttpServer, Path};
|
||||
use actix_web::{App, HttpServer, Path};
|
||||
|
||||
fn index(info: Path<(String, u32)>) -> String {
|
||||
format!("Hello {}! id:{}", info.0, info.1)
|
||||
|
@ -41,7 +41,7 @@ fn index(info: Path<(String, u32)>) -> String {
|
|||
|
||||
fn main() {
|
||||
HttpServer::new(
|
||||
|| Application::new()
|
||||
|| App::new()
|
||||
.resource("/{name}/{id}/index.html", |r| r.with(index)))
|
||||
.bind("127.0.0.1:8080").unwrap()
|
||||
.run();
|
||||
|
|
Loading…
Reference in a new issue