Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 7675561

Browse files
committed
config: allow serving the admin API routes
1 parent f4f61f0 commit 7675561

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

crates/cli/src/server.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ pub fn build_router(
228228
mas_config::HttpResource::Compat => {
229229
router.merge(mas_handlers::compat_router::<AppState>())
230230
}
231+
mas_config::HttpResource::AdminApi => {
232+
let (_, api_router) = mas_handlers::admin_api_router::<AppState>();
233+
router.merge(api_router)
234+
}
231235
// TODO: do a better handler here
232236
mas_config::HttpResource::ConnectionInfo => router.route(
233237
"/connection-info",

crates/config/src/sections/http.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ pub enum Resource {
312312
path: Utf8PathBuf,
313313
},
314314

315+
/// Admin API, served at `/api/admin/v1`
316+
AdminApi,
317+
315318
/// Mount a "/connection-info" handler which helps debugging informations on
316319
/// the upstream connection
317320
#[serde(rename = "connection-info")]

docs/config.schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,21 @@
788788
}
789789
}
790790
},
791+
{
792+
"description": "Admin API, served at `/api/admin/v1`",
793+
"type": "object",
794+
"required": [
795+
"name"
796+
],
797+
"properties": {
798+
"name": {
799+
"type": "string",
800+
"enum": [
801+
"adminapi"
802+
]
803+
}
804+
}
805+
},
791806
{
792807
"description": "Mount a \"/connection-info\" handler which helps debugging informations on the upstream connection",
793808
"type": "object",

0 commit comments

Comments
 (0)