update axum to 7
This commit is contained in:
parent
660f7644fc
commit
ba3ad10fff
4 changed files with 125 additions and 38 deletions
|
@ -22,8 +22,10 @@ async fn main() {
|
|||
let app = app::create(feeds);
|
||||
|
||||
tracing::debug!("Listening on {}", addr);
|
||||
axum::Server::bind(&addr)
|
||||
.serve(app.into_make_service())
|
||||
let listener = tokio::net::TcpListener::bind(&addr)
|
||||
.await
|
||||
.expect("Faileds to listen on the specified address");
|
||||
axum::serve(listener, app.into_make_service())
|
||||
.with_graceful_shutdown(signals::shutdown())
|
||||
.await
|
||||
.expect("Failed to start server");
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use axum::{body::Body, routing::get, Router};
|
||||
use axum::{routing::get, Router};
|
||||
|
||||
use crate::{app::AppState, feeds};
|
||||
|
||||
pub fn all() -> Router<Arc<AppState>, Body> {
|
||||
pub fn all() -> Router<Arc<AppState>> {
|
||||
Router::new()
|
||||
.route("/", get(feeds::route::feeds))
|
||||
.route("/feeds/:id", get(feeds::route::feed))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue