diff --git a/crates/cli/src/server.rs b/crates/cli/src/server.rs index 8d2b0669..9b753aa6 100644 --- a/crates/cli/src/server.rs +++ b/crates/cli/src/server.rs @@ -228,6 +228,10 @@ pub fn build_router( mas_config::HttpResource::Compat => { router.merge(mas_handlers::compat_router::()) } + mas_config::HttpResource::AdminApi => { + let (_, api_router) = mas_handlers::admin_api_router::(); + router.merge(api_router) + } // TODO: do a better handler here mas_config::HttpResource::ConnectionInfo => router.route( "/connection-info", diff --git a/crates/config/src/sections/http.rs b/crates/config/src/sections/http.rs index 0fb8e87a..39e20207 100644 --- a/crates/config/src/sections/http.rs +++ b/crates/config/src/sections/http.rs @@ -312,6 +312,9 @@ pub enum Resource { path: Utf8PathBuf, }, + /// Admin API, served at `/api/admin/v1` + AdminApi, + /// Mount a "/connection-info" handler which helps debugging informations on /// the upstream connection #[serde(rename = "connection-info")] diff --git a/docs/config.schema.json b/docs/config.schema.json index 46024fb9..900203e6 100644 --- a/docs/config.schema.json +++ b/docs/config.schema.json @@ -788,6 +788,21 @@ } } }, + { + "description": "Admin API, served at `/api/admin/v1`", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "enum": [ + "adminapi" + ] + } + } + }, { "description": "Mount a \"/connection-info\" handler which helps debugging informations on the upstream connection", "type": "object",