Initial commit

This commit is contained in:
wanghep
2026-03-20 21:47:30 +08:00
commit 2eab960303
83 changed files with 51694 additions and 0 deletions

View File

@ -0,0 +1,33 @@
$log = "C:\Users\Administrator\Desktop\nanxiang1\run_logs\backend-10000.log"
New-Item -ItemType Directory -Force -Path "C:\Users\Administrator\Desktop\nanxiang1\run_logs" | Out-Null
if (Test-Path $log) {
Remove-Item $log -Force
}
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = "C:\Users\Administrator\Miniforge3\python.exe"
$psi.Arguments = "-m uvicorn app.main:app --app-dir backend --host 127.0.0.1 --port 10000"
$psi.WorkingDirectory = "C:\Users\Administrator\Desktop\nanxiang1"
$psi.UseShellExecute = $false
$psi.RedirectStandardOutput = $true
$psi.RedirectStandardError = $true
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $psi
$null = $process.Start()
Start-Sleep -Seconds 5
if (-not $process.HasExited) {
$stdout = $process.StandardOutput.ReadExisting()
$stderr = $process.StandardError.ReadExisting()
Set-Content -Path $log -Value ($stdout + $stderr) -Encoding UTF8
Write-Output "STARTED_PID=$($process.Id)"
Get-Content $log
} else {
$stdout = $process.StandardOutput.ReadToEnd()
$stderr = $process.StandardError.ReadToEnd()
Set-Content -Path $log -Value ($stdout + $stderr) -Encoding UTF8
Write-Output "EXITED_CODE=$($process.ExitCode)"
Get-Content $log
}