simplify entrypoint

This commit is contained in:
Joe Ardent 2024-02-25 22:54:30 -08:00
parent b924819211
commit 17bec04f2c

View file

@ -30,11 +30,10 @@ async fn main() {
.nest_service("/assets", assets_svc) .nest_service("/assets", assets_svc)
.route("/signup", get(get_signup).post(post_signup)) .route("/signup", get(get_signup).post(post_signup))
.route("/signup_success/:receipt", get(signup_success)) .route("/signup_success/:receipt", get(signup_success))
.layer(session_layer); .layer(session_layer)
.into_make_service();
let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
axum::serve(listener, app.into_make_service()) axum::serve(listener, app).await.unwrap();
.await
.unwrap();
} }