MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / startServerAdvertising

Function startServerAdvertising

__tests__/scripts/static-server.test.ts:338–355  ·  view source on GitHub ↗
(
      dir: string,
      vscodeBasePath: string | null,
    )

Source from the content-addressed store, hash-verified

336
337 describe("vscode base path injection", () => {
338 async function startServerAdvertising(
339 dir: string,
340 vscodeBasePath: string | null,
341 ) {
342 const server = await startStaticServer({
343 port: 0,
344 host: "127.0.0.1",
345 dir,
346 routes: {},
347 vscodeBasePath,
348 });
349 servers.push(server);
350 const address = server.address();
351 if (!address || typeof address === "string") {
352 throw new Error("Static server did not bind to a TCP port");
353 }
354 return `http://127.0.0.1:${address.port}`;
355 }
356
357 function makeBuildDir() {
358 const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-"));

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected