Replies: 5 comments 6 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Sorry, my question was not clear. Yes, I want to use |
Beta Was this translation helpful? Give feedback.
-
axum does not have the concept of named routes the way Flask and actix-web do, so it doesn't have an equivalent to |
Beta Was this translation helpful? Give feedback.
-
This makes it difficult to implement APIs that respect ReST's HATEOAS constraint. |
Beta Was this translation helpful? Give feedback.
-
I'm using #[derive(TypedPath, Deserialize, new)]
#[typed_path("/")]
pub struct Home;
#[derive(TypedPath, Deserialize, new)]
#[typed_path("/subpath/:layout")]
pub struct Subpath {
pub layout: Layout,
}
Router::new()
.typed_get(super::get::home)
.typed_get(super::get::subpath) <a href="{{ crate::web::pages::routes::Home }}">Home</a>
<a
href="{{ crate::web::pages::routes::Subpath::new(layout) }}"
class="link menu-title"
>
Subpath {{ layout }}</span>
</a> |
Beta Was this translation helpful? Give feedback.
-
Hello,
My goal is to re-use what the router already knows to generate an URL.
I found
TypedPath
inaxum-extra
, but this does not play nicely with nested routers.I want to use nested router to make the prefix of the paths configurable with a command line flag.
So
can be configured to be
Is there a way to do what I want ?
Beta Was this translation helpful? Give feedback.
All reactions