File size: 950 Bytes
e9f9fd3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Simple script to serve the DeOldify project root and open the browser
Write-Host "Starting local server for DeOldify Browser..." -ForegroundColor Cyan
Write-Host "Press Ctrl+C to stop the server." -ForegroundColor Yellow

# Get the root directory (parent of the script's directory)
$scriptPath = $MyInvocation.MyCommand.Path
$browserDir = Split-Path $scriptPath
$rootDir = Split-Path $browserDir

# Change to root directory
Set-Location $rootDir
Write-Host "Serving from: $rootDir" -ForegroundColor Gray

# Start the server in the background
$process = Start-Process -FilePath "python" -ArgumentList "-m http.server 8000" -PassThru

# Wait a moment for it to start
Start-Sleep -Seconds 2

# Open the browser to the artistic page
Start-Process "http://localhost:8000/browser/artistic.html"

# Wait for the user to close the script
Read-Host "Server is running. Press Enter to stop server and exit..."

# Stop the server
Stop-Process -Id $process.Id