MCPcopy Create free account
hub / github.com/Qinbf/groundmap / GET

Function GET

tools/debug-console/app/api/workspaces/route.ts:13–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11export const runtime = "nodejs";
12
13export async function GET() {
14 try {
15 const res = await fetch(`${kbApiBase()}/api/workspaces`, { cache: "no-store" });
16 if (!res.ok) return NextResponse.json({ workspaces: [], current: null });
17 const data = (await res.json()) as { workspaces?: unknown; current?: unknown };
18 return NextResponse.json({
19 workspaces: Array.isArray(data.workspaces) ? data.workspaces : [],
20 current: typeof data.current === "string" ? data.current : null,
21 });
22 } catch {
23 // web 没起 / 不可达:返回空列表,选择器自然隐藏,控制台仍可用(落到默认库)
24 return NextResponse.json({ workspaces: [], current: null });
25 }
26}

Callers

nothing calls this directly

Calls 1

kbApiBaseFunction · 0.90

Tested by

no test coverage detected