1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00
This commit is contained in:
Rob Ede
2022-02-18 02:44:02 +00:00
parent aca1dab890
commit fbd3b228e9
48 changed files with 103 additions and 261 deletions

View File

@ -63,13 +63,8 @@ async fn main() -> io::Result<()> {
// store db pool as Data object
.app_data(web::Data::new(pool.clone()))
.wrap(middleware::Logger::default())
.service(
web::resource("/asyncio_weather").route(web::get().to(asyncio_weather)),
)
.service(
web::resource("/parallel_weather")
.route(web::get().to(parallel_weather)),
)
.service(web::resource("/asyncio_weather").route(web::get().to(asyncio_weather)))
.service(web::resource("/parallel_weather").route(web::get().to(parallel_weather)))
})
.bind(("127.0.0.1", 8080))?
.workers(2)