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

Function startServerWithKey

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected