fix: admin api prefix: /rustfs/admin

fix #91

Signed-off-by: bestgopher <84328409@qq.com>
This commit is contained in:
bestgopher
2024-10-16 22:41:31 +08:00
parent 762b436e46
commit f9b6b88a96
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -11,11 +11,16 @@ use tower::Service;
pub type Result<T> = std::result::Result<T, ErrorCode>;
const API_VERSION: &str = "/v3";
pub fn register_admin_router(
ec_store: Option<ECStore>,
) -> impl Service<Request, Response = Response, Error: Into<BoxError>, Future: Send> + Clone {
Router::new()
.nest("/admin/v3", Router::new().route("/pools/list", get(list_pools::handler)))
.nest(
"/rustfs/admin",
Router::new().nest(API_VERSION, Router::new().route("/pools/list", get(list_pools::handler))),
)
.with_state::<()>(ObjectApi::new(ec_store))
.into_service()
}