mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
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 <cursoragent@cursor.com>
This commit is contained in:
parent
dbe3062d1b
commit
d529ff70ff
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue