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

Function startServer

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

Source from the content-addressed store, hash-verified

36 });
37
38 async function startServer(
39 dir: string,
40 overrides: Partial<Parameters<typeof startStaticServer>[0]> = {},
41 ) {
42 const server = await startStaticServer({
43 port: 0,
44 host: "127.0.0.1",
45 dir,
46 routes: {},
47 ...overrides,
48 });
49 servers.push(server);
50
51 const address = server.address();
52 if (!address || typeof address === "string") {
53 throw new Error("Static server did not bind to a TCP port");
54 }
55
56 return `http://127.0.0.1:${address.port}`;
57 }
58
59 async function startHttpServer(server: Server) {
60 await new Promise<void>((resolve, reject) => {

Callers 2

Calls 1

startStaticServerFunction · 0.90

Tested by

no test coverage detected