Files
syops/start-local-backend.ps1
T
2026-04-27 17:03:56 +08:00

23 lines
574 B
PowerShell

$ErrorActionPreference = 'Stop'
$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$pythonExe = Join-Path $projectRoot 'python\python.exe'
$backendDir = Join-Path $projectRoot 'backend'
if (-not (Test-Path $pythonExe)) {
throw "Project Python not found: $pythonExe"
}
if (-not (Test-Path (Join-Path $backendDir '.env'))) {
throw "Backend config not found: $backendDir\.env"
}
Push-Location $backendDir
try {
& $pythonExe -m alembic upgrade head
& $pythonExe -m uvicorn app.main:app --host 127.0.0.1 --port 8000
}
finally {
Pop-Location
}