| # dev-start.ps1 — Lance API + UI en mode watch (Kestrel) sans IIS | |
| # Usage : .\dev-start.ps1 (lance les deux) | |
| # .\dev-start.ps1 -api (API seulement) | |
| # .\dev-start.ps1 -ui (UI seulement) | |
| param( | |
| [switch]$api, | |
| [switch]$ui | |
| ) | |
| $projetApi = "" | |
| $projetUi = "" | |
| $urlApi = "https://localhost:5001" | |
| $urlUi = "https://localhost:5002" | |
| # Si aucun flag, lancer les deux | |
| if (-not $api -and -not $ui) { | |
| $api = $true | |
| $ui = $true | |
| } | |
| if ($api) { | |
| if ([string]::IsNullOrWhiteSpace($projetApi)) { | |
| Write-Host "[ERREUR] Chemin API non configure dans ce depot." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "[DEV] Demarrage API sur $urlApi ..." -ForegroundColor Cyan | |
| Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd '$PSScriptRoot'; dotnet watch run --project $projetApi --urls $urlApi" | |
| } | |
| if ($ui) { | |
| if ([string]::IsNullOrWhiteSpace($projetUi)) { | |
| Write-Host "[ERREUR] Chemin UI non configure dans ce depot." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "[DEV] Demarrage UI sur $urlUi ..." -ForegroundColor Green | |
| Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd '$PSScriptRoot'; dotnet watch run --project $projetUi --urls $urlUi" | |
| } | |
| Write-Host "" | |
| Write-Host "=== Serveurs de developpement ===" -ForegroundColor Yellow | |
| if ($api) { Write-Host " API : $urlApi/swagger" -ForegroundColor Cyan } | |
| if ($ui) { Write-Host " UI : $urlUi" -ForegroundColor Green } | |
| Write-Host " Ctrl+C dans chaque fenetre pour arreter" -ForegroundColor DarkGray | |
| Write-Host "" | |