diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index a2af455..168a5f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,17 +13,8 @@ mod templates; async fn main() -> Result<(), Box<dyn std::error::Error>> { let addr = config::INSTANCE.addr; - let client = mongodb::Client::with_uri_str(&config::INSTANCE.db_uri).await?; - - let make_svc = make_service_fn(move |_conn| { - let client = client.clone(); - - async { - Ok::<_, Infallible>(service_fn(move |req| { - handlers::router(req, client.to_owned()) - })) - } - }); + let make_svc = + make_service_fn(move |_conn| async { Ok::<_, Infallible>(service_fn(handlers::router)) }); let server = Server::bind(&addr).serve(make_svc); let graceful = server.with_graceful_shutdown(shutdown_signal()); |