From d529ff70ff1fde9a31f5ee4417af6f2851c6ee63 Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 6 May 2026 17:26:26 +0800 Subject: [PATCH] fix(start): launch Vite in foreground API mode when WithWeb is set Start the web dev server for -WithWeb even without -Background so 5173 is available in the common foreground run path. Co-authored-by: Cursor --- scripts/start_netx.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/start_netx.ps1 b/scripts/start_netx.ps1 index 2c6b948..6eb921a 100644 --- a/scripts/start_netx.ps1 +++ b/scripts/start_netx.ps1 @@ -96,6 +96,23 @@ if ($Background) { exit 0 } +if ($WithWeb) { + Write-Host "==> Starting Vite dev server in background (foreground API mode)" + $webRoot = Join-Path $projectRoot "web" + $webProc = Start-Process -FilePath "npm.cmd" ` + -ArgumentList @("run", "dev", "--", "--host", $BindHost, "--port", "$WebPort") ` + -WorkingDirectory $webRoot ` + -WindowStyle Hidden ` + -RedirectStandardOutput $webLogFile ` + -RedirectStandardError $webErrFile ` + -PassThru + Set-Content -Path $webPidFile -Value "$($webProc.Id)" + Write-Host "web.pid = $webPidFile" + Write-Host "PID = $($webProc.Id)" + Write-Host "Log = $webLogFile" + Write-Host "Err = $webErrFile" +} + Write-Host "==> Starting netx in foreground" & $pythonExe -m netx_api.main