Skip to content
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 changing port via Environment Variables #620

Open
pnutmath opened this issue Mar 23, 2023 · 2 comments
Open

Allow changing port via Environment Variables #620

pnutmath opened this issue Mar 23, 2023 · 2 comments
Labels
enhancement New feature or request maybe

Comments

@pnutmath
Copy link

Currently, the application only allows changing the port number by passing a command-line parameter when launching the application. However, some users may not have access to this parameter switch, and as a result, they are unable to change the port number.

To make the application more flexible and accessible, I propose adding support for changing the port number via environment variables. This will enable users to specify the port number without having to pass command-line parameters.

The implementation of this feature will involve adding a new configuration option that checks for the value of an environment variable, and if present, uses it as the port number. If the environment variable is not set, the application will default to the current behavior of using the command-line parameter.

We believe this change will improve the usability and accessibility of the application for all users.

Suggested change:

Just setting default value PORT to api-port-from-env should work

fs.String("api-port-from-env", "PORT", "Set the environment variable with the port on which the API should listen - override the default port")		

fs.String("api-port-from-env", "", "Set the environment variable with the port on which the API should listen - override the default port")

@gulien
Copy link
Collaborator

gulien commented Mar 24, 2023

Hello @pnutmath,

I'm not against the idea, but do you have an exemple of a provider / infrastructure that does not allow the setting of a command flag? 😄

@gulien gulien added enhancement New feature or request maybe labels Mar 24, 2023
@pnutmath
Copy link
Author

Our internal layer on top of Kubernetes does not support args and does not allow changing the targetPort at the service level as of now. Change request is also taking time than expected.

It would be helpful to support environment variables for port selection using the standard PORT variable. This would definitely improve usability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe
Projects
None yet
Development

No branches or pull requests

2 participants