mirror of https://github.com/fafhrd91/actix-web
Fix example on README.md
It was missing the actix-rt dependency. Also it's actix_rt::main, and not actix_web::main.
This commit is contained in:
parent
487f90be5b
commit
2ba06d65a3
|
@ -52,6 +52,7 @@ Dependencies:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
actix-rt = "1"
|
||||||
actix-web = "2"
|
actix-web = "2"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@ async fn index(info: web::Path<(u32, String)>) -> impl Responder {
|
||||||
format!("Hello {}! id:{}", info.1, info.0)
|
format!("Hello {}! id:{}", info.1, info.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_web::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
HttpServer::new(|| App::new().service(index))
|
HttpServer::new(|| App::new().service(index))
|
||||||
.bind("127.0.0.1:8080")?
|
.bind("127.0.0.1:8080")?
|
||||||
|
|
Loading…
Reference in New Issue