fix(dev): 本地 API 默认端口改为 3100 避开 Windows 保留段

Hyper-V 常保留 2960-3059,3000 会 EACCES;ensure-port-free 与 Vite 代理从 apps/api/.env 读取 PORT
This commit is contained in:
2026-06-23 15:10:43 +08:00
parent aa1a82e8e3
commit a379f9e522
4 changed files with 20 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import { execSync } from 'node:child_process';
import { resolveApiDevPort } from './dev-api-target.mjs';
const port = process.argv[2] ?? '3000';
const port = process.argv[2] ?? resolveApiDevPort();
function killWindows(portNum) {
let out = '';