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()
|
||||
.route("/", get(index))
|
||||
.route(
|
||||
"/post/:name",
|
||||
get(
|
||||
|Path(name): Path<String>| async move { Redirect::to(&format!("/posts/{}", name)) },
|
||||
),
|
||||
"/post/{name}",
|
||||
get(|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.json", get(posts_json))
|
||||
.route("/feed.xml", get(rss))
|
||||
|
|
Loading…
Reference in a new issue