La inn script for start og stopp av MinAttest i development.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Stop MinAttest Development Environment (Windows)
|
||||
|
||||
Write-Host "🛑 Stopping MinAttest Development Environment..." -ForegroundColor Red
|
||||
|
||||
# Function to kill process on a port
|
||||
function Stop-PortProcess {
|
||||
param (
|
||||
[int]$Port,
|
||||
[string]$Name
|
||||
)
|
||||
$tcpConnection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
|
||||
|
||||
if ($tcpConnection) {
|
||||
$pid = $tcpConnection.OwningProcess
|
||||
Write-Host " Killing $Name (Port $Port, PID $pid)..." -ForegroundColor Yellow
|
||||
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
|
||||
Write-Host " $Name stopped." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " $Name is not running (Port $Port free)."
|
||||
}
|
||||
}
|
||||
|
||||
# 1. Stop Backend (API) - Port 7172
|
||||
Stop-PortProcess -Port 7172 -Name "Backend (API)"
|
||||
|
||||
# 2. Stop BFF - Port 10001
|
||||
Stop-PortProcess -Port 10001 -Name "BFF"
|
||||
|
||||
# 3. Stop Frontend - Port 5173
|
||||
Stop-PortProcess -Port 5173 -Name "Frontend"
|
||||
|
||||
# 4. Stop Aspire Dashboard & Resources (Cleanup)
|
||||
Write-Host " Cleaning up Aspire ports..." -ForegroundColor Yellow
|
||||
Stop-PortProcess -Port 17105 -Name "Aspire AppHost (HTTPS)"
|
||||
Stop-PortProcess -Port 15182 -Name "Aspire AppHost (HTTP)"
|
||||
Stop-PortProcess -Port 21157 -Name "Aspire Dashboard (OTLP)"
|
||||
Stop-PortProcess -Port 22256 -Name "Aspire Resource Service"
|
||||
|
||||
Write-Host "✨ All services stopped." -ForegroundColor Green
|
||||
Reference in New Issue
Block a user