mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
Update to master (#90)
This commit is contained in:
@ -7,7 +7,7 @@ workspace = "../"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
||||
|
||||
futures = "0.1"
|
||||
env_logger = "0.6"
|
||||
|
@ -45,8 +45,8 @@ fn main() -> io::Result<()> {
|
||||
// start http server
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.state(pool.clone()) // <- store db pool in app state
|
||||
.middleware(middleware::Logger::default())
|
||||
.data(pool.clone()) // <- store db pool in app state
|
||||
.wrap(middleware::Logger::default())
|
||||
.route("/{name}", web::get().to_async(index))
|
||||
})
|
||||
.bind("127.0.0.1:8080")?
|
||||
|
Reference in New Issue
Block a user