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

Function startServerWithKey

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

Source from the content-addressed store, hash-verified

242
243 describe("session key injection", () => {
244 async function startServerWithKey(dir: string, sessionApiKey: string) {
245 const server = await startStaticServer({
246 port: 0,
247 host: "127.0.0.1",
248 dir,
249 routes: {},
250 sessionApiKey,
251 });
252 servers.push(server);
253 const address = server.address();
254 if (!address || typeof address === "string") {
255 throw new Error("Static server did not bind to a TCP port");
256 }
257 return `http://127.0.0.1:${address.port}`;
258 }
259
260 it("injects session key script into index.html", async () => {
261 const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-"));

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected