mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 00:38:16 +00:00
21 lines
605 B
Rust
21 lines
605 B
Rust
pub mod error;
|
|
pub mod handlers;
|
|
|
|
use axum::{extract::Request, response::Response, routing::get, BoxError, Router};
|
|
use error::ErrorCode;
|
|
use handlers::list_pools;
|
|
use tower::Service;
|
|
|
|
pub type Result<T> = std::result::Result<T, ErrorCode>;
|
|
|
|
const API_VERSION: &str = "/v3";
|
|
|
|
pub fn register_admin_router() -> impl Service<Request, Response = Response, Error: Into<BoxError>, Future: Send> + Clone {
|
|
Router::new()
|
|
.nest(
|
|
"/rustfs/admin",
|
|
Router::new().nest(API_VERSION, Router::new().route("/pools/list", get(list_pools::handler))),
|
|
)
|
|
.into_service()
|
|
}
|