1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +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

@ -81,12 +81,14 @@ fn main() -> io::Result<()> {
.state(pool.clone())
// enable logger
// .middleware(middleware::Logger::default())
.resource("/asyncio_weather", |r| {
r.route(web::get().to_async(asyncio_weather))
})
.resource("/parallel_weather", |r| {
r.route(web::get().to_async(parallel_weather))
})
.service(
web::resource("/asyncio_weather")
.route(web::get().to_async(asyncio_weather)),
)
.service(
web::resource("/parallel_weather")
.route(web::get().to_async(parallel_weather)),
)
})
.bind("127.0.0.1:8080")?
.start();