Skip to content

Commit

Permalink
Fix axum::serve
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil7 committed Jan 22, 2024
1 parent abcf488 commit 85628e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/axum_webapi_oauth_interception_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::net::SocketAddr;
use axum::response::IntoResponse;
use axum::routing::get;
use axum::Router;
use tokio::net::TcpListener;
use zitadel::axum::introspection::{IntrospectedUser, IntrospectionStateBuilder};

async fn unauthed() -> String {
Expand Down Expand Up @@ -35,8 +36,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let addr = SocketAddr::from(([127, 0, 0, 1], 3001));
println!("listening on: {addr}");
axum::Server::bind(&addr)
.serve(app.into_make_service())
let listener = TcpListener::bind(addr).await?;
axum::serve(listener, app.into_make_service())
.await
.unwrap();

Expand Down

0 comments on commit 85628e3

Please sign in to comment.