VicoXDecember / start.ps1
Rudert's picture
Upload 9 files
2bc5603 verified
# start.ps1 — versi yang stabil untuk Windows
Write-Host "Starting backend server..." -ForegroundColor Green
Copy-Item -Path "./config.ts" -Destination "./backend/config.ts" -Force
# Jalankan backend di jendela baru
Start-Process powershell -ArgumentList "-NoExit", "cd backend; bun run src/index.ts" -WindowStyle Normal
Start-Sleep -Seconds 2
Write-Host "Starting frontend server..." -ForegroundColor Green
# Jalankan frontend di jendela baru
Start-Process powershell -ArgumentList "-NoExit", "cd frontend; bun dev" -WindowStyle Normal
Write-Host "`nBoth servers are starting..." -ForegroundColor Yellow
Write-Host "Backend: http://localhost:4000" -ForegroundColor Cyan
Write-Host "Frontend: http://localhost:3000" -ForegroundColor Cyan
Write-Host "`nPress Ctrl+C to stop both servers.`n" -ForegroundColor DarkGray
try {
while ($true) { Start-Sleep -Seconds 1 }
}
finally {
Write-Host "Stopping all servers..." -ForegroundColor Red
Get-Process -Name "bun" -ErrorAction SilentlyContinue | Stop-Process -Force
}