13 lines
363 B
PowerShell
13 lines
363 B
PowerShell
# restart.ps1
|
|
$port=8000
|
|
|
|
$env:PYTHONUNBUFFERED="1"
|
|
python server.py --port 8000
|
|
|
|
|
|
Write-Host "Killing PID on port $port..." -ForegroundColor Red
|
|
Get-NetTCPConnection -LocalPort $port -ErrorAction SilentlyContinue | ForEach-Object {
|
|
Stop-Process -Id $_.OwningProcess -Force
|
|
}
|
|
Write-Host "Starting Flask..." -ForegroundColor Green
|
|
python server.py --port $port |