-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow localhost api address for backend #730
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and simple! 👌
Can I just request a couple of changes in variable naming:
-
apiAddr
->apiAddress
: we tend to avoid abbreviations when possible, as it may introduce ambiguity -
localHost
->serverAccessHost
,localPort
->serverAccessPort
: I understand the reasoning behind using local here, as this feature will most likely be used for accessing an API that is local to the installation of Publish, but this may not necessarily be the case every time; a more encompassing terminology is "server access", as it describes the host/port used when the server accesses the API.
response.client = clients[0] | ||
response.config = config.get() | ||
|
||
const languagesPromise = request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create two separate variables with the result of the Promise and not just:
const {results: languages} = await request(
`${apiAddress}/api/languages`,
requestOptions
)
580f14f
to
c1329d3
Compare
Closes #726
Allows to specify
localHost
andlocalPort
in the Publish config—if present, the Publish backend will use this as the API address, while the frontend still useshost
andport
. E.g.: