mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 05:00:20 +00:00
feat: add default root route with server info (#36)
This commit is contained in:
parent
2f9e677a19
commit
fdad5fb30a
1 changed files with 9 additions and 1 deletions
|
|
@ -124,7 +124,9 @@ pub fn build_router_with_state(shared: Arc<AppState>) -> (Router, Arc<AppState>)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut router = Router::new().nest("/v1", v1_router);
|
let mut router = Router::new()
|
||||||
|
.route("/", get(get_root))
|
||||||
|
.nest("/v1", v1_router);
|
||||||
|
|
||||||
if ui::is_enabled() {
|
if ui::is_enabled() {
|
||||||
router = router.merge(ui::router());
|
router = router.merge(ui::router());
|
||||||
|
|
@ -3539,6 +3541,12 @@ async fn get_agent_modes(
|
||||||
Ok(Json(AgentModesResponse { modes }))
|
Ok(Json(AgentModesResponse { modes }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn get_root() -> &'static str {
|
||||||
|
"This is a Sandbox Agent server for orchestrating coding agents.\n\
|
||||||
|
See https://sandboxagent.dev for more information.\n\
|
||||||
|
Visit /ui/ for the inspector UI."
|
||||||
|
}
|
||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
path = "/v1/health",
|
path = "/v1/health",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue