INNER CODE UNIT · TypeScript

startServer

kubernetes-sigs/headlamp · app/electron/main.ts:845

async function startServer(
  flags: string[] = [],
  startPort = defaultPort
): Promise<ChildProcessWithoutNullStreams> {
  const defaultServerFilePath = isDev
    ? path.resolve('../backend/headlamp-server')
    : path.join(process.resourcesPath, './headlamp-server');
  // The bind-race E2E uses a fixture for one child generation. Retries must launch
  // the real backend so it remains Electron's direct child on every platform.
  const testServerFilePath = isDev ? process.env.HEADLAMP_E2E_BACKEND_PATH : undefined;
  const serverFilePath = testServerFilePath || defaultServerFilePath;
  delete process.env.HEADLAMP_E2E_BACKEND_PATH;

  actualPort = await findAvailablePort(startPort);

  let serverArgs: string[] = [
    `--listen-addr=${INTERNAL_BACKEND_HOST}`,
    `--port=${actualPort}`,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…