feat: axum type 0.7

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-10-31 22:03:48 +01:00
parent c46bd34e16
commit 21fc2587d4
6 changed files with 364 additions and 195 deletions

View File

@@ -1,4 +1,4 @@
use std::net::SocketAddr;
use std::{net::SocketAddr, str::FromStr};
use axum::{
extract::{FromRef, State},
@@ -58,10 +58,11 @@ async fn main() -> anyhow::Result<()> {
let addr = SocketAddr::from(([127, 0, 0, 1], 3001));
println!("listening on: {addr}");
println!("open browser at: http://localhost:3001/auth/zitadel");
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
let addr = SocketAddr::from_str(&format!("{}:{}", "127.0.0.1", "3000"))?;
let listener = tokio::net::TcpListener::bind(&addr).await?;
axum::serve(listener, app).await?;
Ok(())
}