Files
SPipe/start-lan.ps1
T
bjkim1 21ebb16fb7 SPipe 데모 v2 (2026-10-30) 서버 배포본
- SPipe_server_2026-10-30.zip 내용을 풀어서 등록 (압축 파일은 올리지 않음)
- README에 데모 v2 서버 업데이트 순서 추가, 저장소에 없는 문서 목차 정리
- 패치내역을 docs/로 이동, _worklog.md 추가
- 임시 파일(backend/temp.*)과 API 키가 든 파일은 제외
2026-10-30 11:00:46 +09:00

39 lines
1.6 KiB
PowerShell

# SPipe intranet server
# powershell -ExecutionPolicy Bypass -File .\start-lan.ps1 (build if needed, then serve)
# powershell -ExecutionPolicy Bypass -File .\start-lan.ps1 -Rebuild (force a fresh build)
#
# Web app: http://<this PC's IP>:8080 (all interfaces)
# API: 127.0.0.1:8000 only -- reached through the web server's /api proxy.
param([switch]$Rebuild)
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
if ($Rebuild -or -not (Test-Path 'dist\index.html')) {
Write-Host '[1/3] Building web app...'
npm run build
if ($LASTEXITCODE -ne 0) { throw 'Build failed.' }
} else {
Write-Host '[1/3] Using existing build (dist). Pass -Rebuild after code changes.'
}
Write-Host '[2/3] Starting analysis API on 127.0.0.1:8000...'
$api = Start-Process -FilePath '.venv\Scripts\python.exe' `
-ArgumentList '-m', 'uvicorn', 'backend.main:app', '--host', '127.0.0.1', '--port', '8000' `
-WindowStyle Minimized -PassThru
$ips = Get-NetIPAddress -AddressFamily IPv4 -PrefixOrigin Dhcp, Manual -ErrorAction SilentlyContinue |
Where-Object { $_.IPAddress -notlike '127.*' -and $_.IPAddress -notlike '169.254.*' -and $_.InterfaceAlias -notlike 'vEthernet*' } |
Select-Object -ExpandProperty IPAddress
Write-Host ''
Write-Host '[3/3] Web app is available at:'
foreach ($ip in $ips) { Write-Host " http://${ip}:8080" -ForegroundColor Green }
Write-Host ' (Ctrl+C to stop both servers)'
Write-Host ''
try {
npm run serve:lan
} finally {
if ($api -and -not $api.HasExited) { Stop-Process -Id $api.Id -Force }
}