switch to new axum route format
This commit is contained in:
parent
38e00ef2c2
commit
ecc1fe3299
1 changed files with 3 additions and 5 deletions
|
@ -324,12 +324,10 @@ pub fn new(dirs: &DirsConfig) -> Router<AppState> {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/", get(index))
|
.route("/", get(index))
|
||||||
.route(
|
.route(
|
||||||
"/post/:name",
|
"/post/{name}",
|
||||||
get(
|
get(|Path(name): Path<String>| async move { Redirect::to(&format!("/posts/{name}")) }),
|
||||||
|Path(name): Path<String>| async move { Redirect::to(&format!("/posts/{}", name)) },
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.route("/posts/:name", get(post))
|
.route("/posts/{name}", get(post))
|
||||||
.route("/posts", get(posts))
|
.route("/posts", get(posts))
|
||||||
.route("/posts.json", get(posts_json))
|
.route("/posts.json", get(posts_json))
|
||||||
.route("/feed.xml", get(rss))
|
.route("/feed.xml", get(rss))
|
||||||
|
|
Loading…
Reference in a new issue