1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

update web api

This commit is contained in:
Nikolay Kim
2019-03-06 15:51:56 -08:00
parent 1edbb348d9
commit 51860a4f2a
3 changed files with 35 additions and 36 deletions

View File

@ -48,7 +48,7 @@ fn main() -> io::Result<()> {
HttpServer::new(move || {
App::new()
.state(pool.clone()) // <- store db pool in app state
.resource("/{name}", |r| r.route(web::get().to_async(index)))
.route("/{name}", web::get().to_async(index))
})
.bind("127.0.0.1:8080")?
.start();