switch to new axum route format

This commit is contained in:
slonkazoid 2025-01-30 19:20:37 +03:00
parent 38e00ef2c2
commit ecc1fe3299
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM

View file

@ -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))