-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-deploy.ps1
25 lines (22 loc) · 883 Bytes
/
test-deploy.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
# Script to test the deployment locally using a simple HTTP server
# First, build the project
Write-Host "Building the project..."
./run.ps1
# Check if npx is available
$npxAvailable = $null
try {
$npxAvailable = Get-Command npx -ErrorAction SilentlyContinue
} catch {
$npxAvailable = $null
}
if ($npxAvailable) {
# Start a local server to test the deployment
Write-Host "Starting a local server to test the deployment..."
Write-Host "Your site will be available at: http://localhost:3000/branch-pad/"
Write-Host "Press Ctrl+C to stop the server"
npx serve --listen 3000 out
} else {
Write-Host "npx is not available. Please install Node.js to use the 'serve' package."
Write-Host "Alternatively, you can use any HTTP server to serve the 'out' directory."
Write-Host "For example, with Python: python -m http.server 3000 --directory out"
}