-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart-services.ps1
More file actions
52 lines (37 loc) · 2.31 KB
/
start-services.ps1
File metadata and controls
52 lines (37 loc) · 2.31 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
# Start all backend services for UrbanX
Write-Host "Starting UrbanX Services..." -ForegroundColor Green
# Start Catalog Service
Write-Host "Starting Catalog Service..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Services/Catalog/UrbanX.Services.Catalog" -WindowStyle Hidden
Start-Sleep -Seconds 2
# Start Order Service
Write-Host "Starting Order Service..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Services/Order/UrbanX.Services.Order" -WindowStyle Hidden
Start-Sleep -Seconds 2
# Start Merchant Service
Write-Host "Starting Merchant Service..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Services/Merchant/UrbanX.Services.Merchant" -WindowStyle Hidden
Start-Sleep -Seconds 2
# Start Payment Service
Write-Host "Starting Payment Service..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Services/Payment/UrbanX.Services.Payment" -WindowStyle Hidden
Start-Sleep -Seconds 2
# Start Identity Service
Write-Host "Starting Identity Service..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Services/Identity/UrbanX.Services.Identity" -WindowStyle Hidden
Start-Sleep -Seconds 2
# Start Gateway
Write-Host "Starting API Gateway..." -ForegroundColor Cyan
Start-Process -FilePath "dotnet" -ArgumentList "run", "--no-build" -WorkingDirectory "src/Gateway/UrbanX.Gateway" -WindowStyle Hidden
Write-Host "`nAll services started!" -ForegroundColor Green
Write-Host "Catalog: http://localhost:5001" -ForegroundColor Yellow
Write-Host "Order: http://localhost:5002" -ForegroundColor Yellow
Write-Host "Merchant: http://localhost:5003" -ForegroundColor Yellow
Write-Host "Payment: http://localhost:5004" -ForegroundColor Yellow
Write-Host "Identity: http://localhost:5005" -ForegroundColor Yellow
Write-Host "Gateway: http://localhost:5000" -ForegroundColor Yellow
Write-Host "`nPress any key to stop all services..." -ForegroundColor White
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
# Stop all dotnet processes
Get-Process dotnet | Stop-Process -Force
Write-Host "All services stopped." -ForegroundColor Green