You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like for the CLI to print the real address being used, so either app.hostname or "localhost" / "127.0.0.1".
The simplest way would be to hostname == undefined to fallback to 127.0.0.1 and not on 0.0.0.0 (0.0.0.0 also is said to be a bad practice if not really needed).
By doing this way, this piece of code already existing would work perfectly and, explicity specifying hostname to be 0.0.0.0, would make it work.
alexandercerutti
changed the title
Cli: show real hostname being used
Hhttp: show real hostname being used when starting the server
Jan 5, 2025
alexandercerutti
changed the title
Hhttp: show real hostname being used when starting the server
http: show real hostname being used when starting the server
Jan 5, 2025
@alexandercerutti thanks for reporting this issue, the reason I did it so as to avoid running into unknown deployment issues. Probably we can remove the default behaviour of listening to 0.0.0.0 and add a deployment documentation.
Is your feature request related to a problem? Please describe.
When starting the webserver, intent shows:
However, the default behavior is listening on
0.0.0.0
whenapp.hostname
is not defined, not onlocalhost
/127.0.0.1
.This behavior is not documented in the website (or I couldn't find it). It seems to be described only as a Typescript typing, without a comment.
So the current behavior is a bit misleading IMHO.
hostname
seems to get used only for selecting server address and to print the URL.intent/packages/core/lib/rest/foundation/server.ts
Lines 121 to 123 in 92c4ee9
Describe the solution you'd like
I'd like for the CLI to print the real address being used, so either
app.hostname
or"localhost"
/"127.0.0.1"
.The simplest way would be to
hostname == undefined
to fallback to127.0.0.1
and not on0.0.0.0
(0.0.0.0
also is said to be a bad practice if not really needed).By doing this way, this piece of code already existing would work perfectly and, explicity specifying hostname to be
0.0.0.0
, would make it work.intent/packages/core/lib/rest/foundation/server.ts
Lines 159 to 162 in 92c4ee9
However, I can understand this could be a breaking change, so it depends on how it is the will to proceed.
I'm also willing to open a PR and change the documentation.
Let me know.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: