use axum::{
    Router,
    response::Redirect,
    routing::{get, post},
};
use axum_extra::routing::RouterExt as _;

use crate::app::App;

mod add_handlers;
mod list_handlers;

pub(super) fn new_router() -> Router<App> {
    Router::<App>::new()
        .route("/", get(|| async move { Redirect::to("list/") }))
        .route_with_tsr("/list/", get(list_handlers::get))
        .route("/list/add", post(add_handlers::post))
}
