1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Start migrating to Axum

Now with the homepage and the static files
This commit is contained in:
Quentin Gliech
2022-03-24 09:01:26 +01:00
parent d177444c83
commit 797257cce7
8 changed files with 182 additions and 106 deletions

View File

@ -203,20 +203,16 @@ impl Options {
.context("could not watch for templates changes")?;
}
// Start the server
let root = mas_handlers::root(&pool, &templates, &key_store, &encrypter, &mailer, &config);
let router =
mas_handlers::router(&pool, &templates, &key_store, &encrypter, &mailer, &config);
// Explicitely the config to properly zeroize secret keys
drop(config);
let warp_service = warp::service(root);
let service = mas_http::ServerLayer::default().layer(warp_service);
info!("Listening on http://{}", listener.local_addr().unwrap());
Server::from_tcp(listener)?
.serve(Shared::new(service))
.serve(router.into_make_service())
.with_graceful_shutdown(shutdown_signal())
.await?;