We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7f9168 commit 05bc5f1Copy full SHA for 05bc5f1
Commands/Start-Htmx.ps1
@@ -335,9 +335,12 @@ function Start-Htmx {
335
if (-not $myParams['ServerUrl']) {
336
$ServerUrl = $myParams['ServerUrl'] =
337
if (-not $ServerUrl) {
338
- # If we are on unix, and a port has not been set, we will use port 80.
339
- if ($PSVersionTable.Platform -eq 'Unix') {
340
- if (-not $port) { $port = 80}
+ # If we are on unix, and a port has not been set,
+ # and an environment variable indicates we are in a container, we will use port 80.
+ if ($PSVersionTable.Platform -eq 'Unix' -and (
341
+ Get-ChildItem env: | Where-Object Name -Match InContainer
342
+ )) {
343
+ if (-not $port) { $port = 80 }
344
"http://*:$port/"
345
} else {
346
# If we are on Windows, we will use a random port between 4kb and 32kb.
0 commit comments