mod exporter;
mod list;
mod static_files;
use std::sync::Arc;
use axum::{response::IntoResponse, routing, Router};
use http::StatusCode;
use crate::state::AppState;
pub fn get_app_router(state: Arc<AppState>) -> Router {
Router::new()
.route("/", routing::get(list::list_leases))
.route("/exporter", routing::get(exporter::export_metrics))
.route("/static/:path", routing::get(static_files::static_files))
.fallback(handler_404)
.with_state(state)
}
async fn handler_404() -> impl IntoResponse {
(StatusCode::NOT_FOUND, "404 Not Found")
}