-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.ps1
More file actions
66 lines (57 loc) · 1.88 KB
/
start-dev.ps1
File metadata and controls
66 lines (57 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Start Development Environment
# Avvia API e Web in parallelo
Write-Host "?? Starting Secure Boot Dashboard Development Environment" -ForegroundColor Cyan
Write-Host ""
# Start API in background
Write-Host "Starting API on https://localhost:7120..." -ForegroundColor Green
$apiJob = Start-Job -ScriptBlock {
Set-Location $using:PSScriptRoot
Set-Location SecureBootDashboard.Api
dotnet run
}
# Wait a bit for API to start
Start-Sleep -Seconds 3
# Start Web in background
Write-Host "Starting Web on https://localhost:7001..." -ForegroundColor Green
$webJob = Start-Job -ScriptBlock {
Set-Location $using:PSScriptRoot
Set-Location SecureBootDashboard.Web
dotnet run
}
# Wait a bit for Web to start
Start-Sleep -Seconds 3
Write-Host ""
Write-Host "? Services started!" -ForegroundColor Green
Write-Host ""
Write-Host "?? Available URLs:" -ForegroundColor Yellow
Write-Host " API: https://localhost:7120" -ForegroundColor White
Write-Host " Swagger: https://localhost:7120/swagger" -ForegroundColor White
Write-Host " Web: https://localhost:7001" -ForegroundColor White
Write-Host ""
Write-Host "Press Ctrl+C to stop all services" -ForegroundColor Yellow
Write-Host ""
# Monitor jobs
try {
while ($true) {
# Show API output
$apiOutput = Receive-Job $apiJob
if ($apiOutput) {
Write-Host "[API] " -ForegroundColor Blue -NoNewline
Write-Host $apiOutput
}
# Show Web output
$webOutput = Receive-Job $webJob
if ($webOutput) {
Write-Host "[WEB] " -ForegroundColor Magenta -NoNewline
Write-Host $webOutput
}
Start-Sleep -Milliseconds 500
}
}
finally {
Write-Host ""
Write-Host "?? Stopping services..." -ForegroundColor Red
Stop-Job $apiJob, $webJob
Remove-Job $apiJob, $webJob
Write-Host "? All services stopped" -ForegroundColor Green
}