insert subscription, db test isolation

This commit is contained in:
Andre Heber
2024-02-15 20:14:27 +01:00
parent bb94bde843
commit a0aa12872d
7 changed files with 90 additions and 41 deletions

View File

@ -6,10 +6,10 @@ use zero2prod::startup::run;
#[tokio::main]
async fn main() -> std::io::Result<()> {
let config = get_configuration().expect("Failed to read configuration");
let connection = PgPoolOptions::new()
let connection_pool = PgPoolOptions::new()
.max_connections(10).connect(&config.database.connection_string()).await.expect("Failed to connect to Postgres.");
let address = format!("127.0.0.1:{}", config.application_port);
let listener = TcpListener::bind(address).expect("Failed to bind random port");
run(listener, connection)?.await
run(listener, connection_pool)?.await
}