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

Function startServerWithKey

__tests__/scripts/static-server.test.ts:379–393  ·  view source on GitHub ↗
(dir: string, sessionApiKey: string)

Source from the content-addressed store, hash-verified

377
378 describe("session key injection", () => {
379 async function startServerWithKey(dir: string, sessionApiKey: string) {
380 const server = await startStaticServer({
381 port: 0,
382 host: "127.0.0.1",
383 dir,
384 routes: {},
385 sessionApiKey,
386 });
387 servers.push(server);
388 const address = server.address();
389 if (!address || typeof address === "string") {
390 throw new Error("Static server did not bind to a TCP port");
391 }
392 return `http://127.0.0.1:${address.port}`;
393 }
394
395 it("injects session key script into index.html", async () => {
396 const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-"));

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected