mirror of
https://github.com/actix/actix-website
synced 2024-11-24 08:43:01 +01:00
Merge pull request #179 from vo9312/update-database-example
This commit is contained in:
commit
29b65d053c
@ -64,7 +64,7 @@ fn main() {
|
|||||||
|
|
||||||
// Start http server
|
// Start http server
|
||||||
HttpServer::new(move || {
|
HttpServer::new(move || {
|
||||||
App::with_state(State { db: addr.clone() })
|
App::new::data(State { db: addr.clone() })
|
||||||
.resource("/{name}", |r| r.method(Method::GET).a(index))
|
.resource("/{name}", |r| r.method(Method::GET).a(index))
|
||||||
})
|
})
|
||||||
.bind("127.0.0.1:8080")
|
.bind("127.0.0.1:8080")
|
||||||
|
Loading…
Reference in New Issue
Block a user