24 lines
520 B
PowerShell
24 lines
520 B
PowerShell
param (
|
|
[int]$Port = 0
|
|
)
|
|
|
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$gatewayDir = Join-Path (Split-Path -Parent $scriptDir) "gateway"
|
|
|
|
if ($Port -le 0) {
|
|
$envPort = $env:PORT -as [int]
|
|
if ($envPort) {
|
|
$Port = $envPort
|
|
} else {
|
|
$Port = 8000
|
|
}
|
|
}
|
|
|
|
Write-Host "Starting FastAPI Gateway local dev server on port $Port..." -ForegroundColor Cyan
|
|
Push-Location $gatewayDir
|
|
try {
|
|
& .venv\Scripts\uvicorn app.main:app --reload --port $Port
|
|
} finally {
|
|
Pop-Location
|
|
}
|