till I figure out how async actually works

This commit is contained in:
LinlyBoi
2023-12-18 00:20:35 +02:00
parent f5c60e19d4
commit 62f614acb8

View File

@@ -12,6 +12,12 @@ async fn main() -> std::io::Result<()> {
dotenv().ok();
std::env::set_var("RUST_LOG", "debug");
env_logger::init();
let database_url = env::var("DATABASE_URL").expect("Put a DB url in the .env file dumbass");
let pool = sqlx::postgres::PgPoolOptions::new()
.max_connections(10)
.connect(database_url.as_str())
.await
.expect("No pool connection man :(");
HttpServer::new(|| {
App::new()
.service(echo)