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

Function startServer

__tests__/scripts/static-server.test.ts:28–47  ·  view source on GitHub ↗
(
    dir: string,
    overrides: Partial<Parameters<typeof startStaticServer>[0]> = {},
  )

Source from the content-addressed store, hash-verified

26 });
27
28 async function startServer(
29 dir: string,
30 overrides: Partial<Parameters<typeof startStaticServer>[0]> = {},
31 ) {
32 const server = await startStaticServer({
33 port: 0,
34 host: "127.0.0.1",
35 dir,
36 routes: {},
37 ...overrides,
38 });
39 servers.push(server);
40
41 const address = server.address();
42 if (!address || typeof address === "string") {
43 throw new Error("Static server did not bind to a TCP port");
44 }
45
46 return `http://127.0.0.1:${address.port}`;
47 }
48
49 async function startHttpServer(server: Server) {
50 await new Promise<void>((resolve, reject) => {

Callers 1

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected