New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fastify.url to return the current url of the application #4586
Comments
We should also provide the correct |
Yes, exactly |
How is this different from the discussion in #387? |
In the discussion is used for Another main different is one of them depends on |
i already see that people report bugs, saying that fastify.url does not respect their top level domain and just report http://127.0.0.1:3000 (instead of http://www.mysecret.tld:3000) |
Ouch, now that I think about it, it will likely happen. Maybe we should call it localUrl instead? |
Or |
listenOrigin is likely the more correct one |
I would prefer something like originUrl as listen is a Verb indicating a function. |
originUrl does not indicate what origin it is. and it is odd to have both origin and url since origin is part of url. Would |
|
… getter) (fastify#4586) Co-authored-by: James Sumners <james@sumners.email>
…nix socket test in win32 platform) (fastify#4586)
…ul ignore unix socket on windows platform) (fastify#4586)
Prerequisites
🚀 Feature Proposal
I think we should add
fastify.url
as it would be a convenient API.I spend way too much time coding
http://localhost:${server.server.address().port
, so maybe we could get it done in Fastify itself.Wdyt?
Motivation
No response
Example
In Platformatic, we addded:
https://github.com/platformatic/platformatic/blob/d8ad6a97e552c4d2c365a27b1a427738aaa6833c/packages/service/index.js#L208-L215
The text was updated successfully, but these errors were encountered: