-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunWebsite.ps1
29 lines (22 loc) · 1.24 KB
/
runWebsite.ps1
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
Write-Host "Starting up local development server of STAAR-LAB on port 3000. A window will automatically pop up with server."
Write-Host "This command will also set up Pocketbase Server and open a window of that as well."
Write-Host "Press q in the terminal to end Pocketbase Server and Local Dev Server"
$pocketServer = Start-Process -FilePath "powershell" -ArgumentList "Invoke-Expression 'cmd /c start powershell -Command { Start-Process 'http://127.0.0.1:8090/_/#/login'; .\pocketbase serve}'" -PassThru
$pocketServer | Export-Clixml -Path (Join-Path $ENV:TEMP 'pocketbaseserver.xml')
# Invoke-Expression 'cmd /c start powershell -Command { Start-Process "http://localhost:3000/"; npm run dev'
"Press any key to end Next.js Server and Pocketbase Server: "
[bool]$userSure = 0
do {
if (([System.Console]::KeyAvailable)) {
$userInput = Read-Host "Are you sure you want to end process? (Y/N)"
switch ($userInput) {
{ @("y", "Y") } { $userSure = 1 }
default {
Write-Host "Invalid input or no was selected. Continuing servers."
}
}
}
} until ((![System.Console]::KeyAvailable) -and (userSure))
$pocketServer | Stop-Process
# Start-Process "http://localhost:3000/"
# npm run dev