MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / allocatePort

Function allocatePort

apps/local/src/serve.ts:115–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115async function allocatePort(): Promise<number> {
116 const probe = Bun.serve({
117 port: 0,
118 hostname: "127.0.0.1",
119 fetch: () => new Response(),
120 });
121 const port = probe.port ?? 0;
122 probe.stop(true);
123 return port;
124}
125
126async function startViteChild(): Promise<ViteChild> {
127 const vitePort = await allocatePort();

Callers 1

startViteChildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected