use axum::{ extract::State, routing::{get, post}, Router, }; use crate::state::RoutableAppState; mod index; mod login; /// Build a router for the application, in a specific subpath eg `/yunohost/sso/` pub fn router(subpath: Option, state: RoutableAppState) -> Router { let app = Router::new() .route("/", get(index::route)) .route("/login/", post(login::route)) .with_state(state); if let Some(p) = subpath { Router::new() .nest(&p, app) } else { app } }