$ErrorActionPreference = "Stop" $Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path) Set-Location $Root if (!(Test-Path .venv)) { throw ".venv not found, run scripts/install_windows_env.ps1 first" } if (!(Test-Path .env)) { throw ".env not found, copy from .env.example" } .\.venv\Scripts\Activate.ps1 Get-Content .env | ForEach-Object { if ($_ -match "^\s*#") { return } if ($_ -match "^\s*$") { return } $parts = $_ -split "=", 2 if ($parts.Length -eq 2) { [System.Environment]::SetEnvironmentVariable($parts[0], $parts[1], "Process") } } $hostValue = if ($env:APP_HOST) { $env:APP_HOST } else { "0.0.0.0" } $portValue = if ($env:APP_PORT) { $env:APP_PORT } else { "8000" } python -m uvicorn app.main:app --host $hostValue --port $portValue