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

Function allocatePort

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

Source from the content-addressed store, hash-verified

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

Callers 1

startViteChildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected