mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
chore: fmt
This commit is contained in:
parent
de0411ca31
commit
db35977fbe
@ -145,13 +145,11 @@ async fn main() -> std::io::Result<()> {
|
|||||||
let pool = config.pg.create_pool(None, NoTls).unwrap();
|
let pool = config.pg.create_pool(None, NoTls).unwrap();
|
||||||
|
|
||||||
let server = HttpServer::new(move || {
|
let server = HttpServer::new(move || {
|
||||||
App::new()
|
App::new().app_data(web::Data::new(pool.clone())).service(
|
||||||
.app_data(web::Data::new(pool.clone()))
|
web::resource("/users")
|
||||||
.service(
|
.route(web::post().to(add_user))
|
||||||
web::resource("/users")
|
.route(web::get().to(get_users)),
|
||||||
.route(web::post().to(add_user))
|
)
|
||||||
.route(web::get().to(get_users))
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
.bind(config.server_addr.clone())?
|
.bind(config.server_addr.clone())?
|
||||||
.run();
|
.run();
|
||||||
|
Loading…
Reference in New Issue
Block a user