summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-04-02 18:23:45 -0400
committerAdam T. Carpenter <atc@53hor.net>2021-04-02 18:23:45 -0400
commitb1c45640a72300433800c8370657335616f8c541 (patch)
treead7df1bfa6f59390ad227183364b308ab2137ed0 /src/main.rs
parent7633bf5855ae5359d0fe280970e5c5c210c536b3 (diff)
downloadtwinh-b1c45640a72300433800c8370657335616f8c541.tar.xz
twinh-b1c45640a72300433800c8370657335616f8c541.zip
replaced mongo with sled, added some basic functional google oauth2 code
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
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());