mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-17 21:34:32 +01:00
update readme example
This commit is contained in:
parent
97e2bcd055
commit
a5a36ff194
@ -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…
x
Reference in New Issue
Block a user