mirror of
https://github.com/actix/examples
synced 2024-11-27 16:02:57 +01:00
Update db/pg to v4 (#509)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
4174a4c62f
commit
663807baa0
@ -4,12 +4,12 @@ version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "3"
|
||||
config = "0.10.1"
|
||||
deadpool-postgres = "0.5.0"
|
||||
actix-web = "4.0.0-beta.21"
|
||||
config = "0.11.0"
|
||||
deadpool-postgres = { version = "0.10.1", features = ["serde"] }
|
||||
derive_more = "0.99.2"
|
||||
dotenv = "0.15.0"
|
||||
serde = { version = "1.0.104", features = ["derive"] }
|
||||
tokio-pg-mapper = "0.1"
|
||||
tokio-pg-mapper-derive = "0.1"
|
||||
tokio-postgres = "0.5.1"
|
||||
tokio-pg-mapper = "0.2.0"
|
||||
tokio-pg-mapper-derive = "0.2.0"
|
||||
tokio-postgres = "0.7.5"
|
||||
|
@ -116,11 +116,11 @@ async fn main() -> std::io::Result<()> {
|
||||
dotenv().ok();
|
||||
|
||||
let config = crate::config::Config::from_env().unwrap();
|
||||
let pool = config.pg.create_pool(NoTls).unwrap();
|
||||
let pool = config.pg.create_pool(None, NoTls).unwrap();
|
||||
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.data(pool.clone())
|
||||
.app_data(web::Data::new(pool.clone()))
|
||||
.service(web::resource("/users").route(web::post().to(add_user)))
|
||||
})
|
||||
.bind(config.server_addr.clone())?
|
||||
|
Loading…
Reference in New Issue
Block a user