Skip to content

Commit

Permalink
Adapt to new axum 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mw committed Dec 11, 2023
1 parent 90899f5 commit 1969216
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/api.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use axum::{
routing::{get, post},
Router, Server,
Router
};

use crate::routes::{compile, create_gist, evaluate, static_css, static_html, static_js};
Expand Down Expand Up @@ -33,7 +33,6 @@ pub async fn serve(addr: SocketAddr, github_client: GithubClient) -> Result<()>
.route("/gist.json", post(create_gist))
.with_state(github_client)
.nest("/static", static_routes);
Ok(Server::bind(&addr)
.serve(router.into_make_service())
.await?)
let listener = tokio::net::TcpListener::bind(&addr).await?;
Ok(axum::serve(listener, router).await?)
}

0 comments on commit 1969216

Please sign in to comment.