-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router::route_service()
example code is out of date
#2536
Comments
Ah yes that example is indeed out of date. axum always uses
It can still be used to route to any service regardless of the HTTP method. |
Router::route_service()
example code out of date?Router::route_service()
example code if out of date
Router::route_service()
example code if out of dateRouter::route_service()
example code is out of date
So what happens if I supply a |
"Supply" it how? |
Ah, I missed that the non- |
Exactly. You might also wanna run the MethodRouter, without using Router at all. |
It would be great if the example code or documentation could illustrate how to use this with State and Path. I have a function like so async fn handler(State(db): State<Arc<Database>>,
Path(id): Path<String>,
) and providing to There isn't any documentation or examples to figure out how to resolve this unfortunately |
@JosiahParry |
The current documentation for
axum::Router::route_service()
has an example that contains the following lines:However, despite what the comments in the code say, both responses appear to have
axum::body::Body
as their bodies, and there is currently noaxum::body::BoxBody
in the crate. I assume thatBoxBody
was removed in an earlier version and the example was only partially updated, but that just raises the question: What isany_service()
good for now?The text was updated successfully, but these errors were encountered: