MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / router

Function router

crates/opencode-server/src/routes.rs:43–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41};
42
43pub fn router() -> Router<Arc<ServerState>> {
44 Router::new()
45 .route("/", get(web_index))
46 .route("/health", get(health))
47 .route("/event", get(event_stream))
48 .route("/path", get(get_paths))
49 .route("/vcs", get(get_vcs_info))
50 .route("/command", get(list_commands))
51 .route("/agent", get(list_agents))
52 .route("/skill", get(list_skills))
53 .route("/lsp", get(get_lsp_status))
54 .route("/formatter", get(get_formatter_status))
55 .route("/auth/{id}", put(set_auth).delete(delete_auth))
56 .route("/doc", get(get_doc))
57 .route("/log", post(write_log))
58 .nest("/session", session_routes().layer(middleware::from_fn(inject_opencode_directory)))
59 .nest("/provider", provider_routes())
60 .nest("/config", config_routes())
61 .nest("/mcp", mcp_routes())
62 .nest("/file", file_routes())
63 .nest("/find", find_routes())
64 .nest("/permission", permission_routes())
65 .nest("/project", project_routes())
66 .nest("/pty", pty_routes())
67 .nest("/question", question_routes())
68 .nest("/tui", tui_routes())
69 .nest("/global", global_routes())
70 .nest("/experimental", experimental_routes())
71 .nest("/plugin", plugin_auth_routes())
72}
73
74/// Injected by middleware from x-opencode-directory header for session create.
75#[derive(Clone)]

Callers 2

run_serverFunction · 0.85
run_server_with_stateFunction · 0.85

Calls 15

newFunction · 0.85
session_routesFunction · 0.85
provider_routesFunction · 0.85
config_routesFunction · 0.85
mcp_routesFunction · 0.85
file_routesFunction · 0.85
find_routesFunction · 0.85
permission_routesFunction · 0.85
project_routesFunction · 0.85
pty_routesFunction · 0.85
question_routesFunction · 0.85
tui_routesFunction · 0.85

Tested by

no test coverage detected