The trait bound Router: IntoResponse
is not satisfied
#2406
Answered
by
davidpdrsn
Benbellah-Owino
asked this question in
Q&A
-
SummaryI,m getting the following when I try to run the following project - https://github.com/Benbellah-Owino/axum_todo
What can be the problem? use crate::handlers::{create_todo, delete_todo, get_todo, update_todo};
use axum::routing::{delete, post };
use axum::{ Router, response::IntoResponse};
use crate::db::connect_db;
use axum_macros::debug_handler;
#[debug_handler]
pub async fn routes() -> Router{
let db = connect_db().await;
Router::new()
.route("/todo", post(create_todo).get(get_todo))
.route("/todo/:id",delete(delete_todo))
.with_state(db)
} axum version0.7.1 |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Dec 4, 2023
Replies: 1 comment 1 reply
-
Because you have #[debug_handler] on the function. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Benbellah-Owino
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because you have #[debug_handler] on the function.