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

Function startServerWithKey

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

Source from the content-addressed store, hash-verified

642
643 describe("session key injection", () => {
644 async function startServerWithKey(dir: string, sessionApiKey: string) {
645 const server = await startStaticServer({
646 port: 0,
647 host: "127.0.0.1",
648 dir,
649 routes: {},
650 sessionApiKey,
651 });
652 servers.push(server);
653 const address = server.address();
654 if (!address || typeof address === "string") {
655 throw new Error("Static server did not bind to a TCP port");
656 }
657 return `http://127.0.0.1:${address.port}`;
658 }
659
660 it("injects session key script into index.html", async () => {
661 const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-"));

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected