import { c as defineEventHandler, g as getQuery } from '../../../_/nitro.mjs';
import { f as findProcess } from '../../../_/index2.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '../../../virtual/_commonjsHelpers.mjs';
import '../../../virtual/_os.mjs';
import 'os';
import '../../../virtual/_path.mjs';
import 'fs';
import 'path';
import '../../../virtual/_child_process.mjs';
import 'child_process';

const getPort_get = defineEventHandler(async (event) => {
  const port = getQuery(event).port;
  if (port) {
    return findProcess("port", port);
  } else {
    return findProcess("name", "", true);
  }
});

export { getPort_get as default };
