journal/scripts/run-webgateway.ps1
stan44 069b38071c Added Web WebGateway
Added connector so gateway works.
scripts are much more polished and functional.
2026-02-27 11:03:53 -06:00

49 lines
1.3 KiB
PowerShell

param(
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
[string]$Urls = "http://0.0.0.0:5180",
[string]$ProjectRoot
)
$commonScript = Join-Path $PSScriptRoot "script-common.ps1"
if (-not (Test-Path $commonScript)) {
throw "Missing helper script: $commonScript"
}
. $commonScript
$repoRoot = Resolve-JournalRepoRoot -StartPath $PSScriptRoot
$gatewayProject = Resolve-JournalWebGatewayProjectPath -RepoRoot $repoRoot
$effectiveProjectRoot = if ([string]::IsNullOrWhiteSpace($ProjectRoot)) {
$repoRoot
}
else {
[System.IO.Path]::GetFullPath($ProjectRoot)
}
if (-not (Test-Path $effectiveProjectRoot)) {
throw "ProjectRoot does not exist: $effectiveProjectRoot"
}
Clear-JournalProxyEnv
Initialize-JournalDotnetEnv -RepoRoot $repoRoot
$env:JOURNAL_PROJECT_ROOT = $effectiveProjectRoot
Write-Host "Running Journal.WebGateway ($Configuration)..." -ForegroundColor Cyan
Write-Host "Project: $gatewayProject" -ForegroundColor DarkGray
Write-Host "URLs: $Urls" -ForegroundColor DarkGray
Write-Host "JOURNAL_PROJECT_ROOT: $effectiveProjectRoot" -ForegroundColor DarkGray
$runArgs = @(
"run",
"--project", $gatewayProject,
"-c", $Configuration,
"--no-launch-profile",
"--urls", $Urls,
"-p:RestoreIgnoreFailedSources=true",
"-p:NuGetAudit=false"
)
& dotnet @runArgs
exit $LASTEXITCODE