MCPcopy Create free account
hub / github.com/vercel/vercel / withHttpServer

Function withHttpServer

packages/node/test/unit/dev.test.ts:36–41  ·  view source on GitHub ↗
(hander: (req: any, res: any) => void)

Source from the content-addressed store, hash-verified

34afterAll(() => Promise.all(teardown.map((fn: any) => fn())));
35
36async function withHttpServer(hander: (req: any, res: any) => void) {
37 const server = createServer(hander);
38 teardown.push(promisify(server.close.bind(server)));
39 const address = await listen(server, { port: 0, host: '127.0.0.1' });
40 return address.toString();
41}
42
43async function withDevServer(
44 entrypoint: string,

Callers 1

dev.test.tsFile · 0.85

Calls 3

pushMethod · 0.65
bindMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected