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

[Suggestion] use environment variable for echo.Start() #1320

Closed
2 tasks done
tkitsunai opened this issue Apr 18, 2019 · 2 comments
Closed
2 tasks done

[Suggestion] use environment variable for echo.Start() #1320

tkitsunai opened this issue Apr 18, 2019 · 2 comments
Assignees
Labels

Comments

@tkitsunai
Copy link

Issue Description

Suggestion to use environment variable for echo.Start()

Checklist

  • No typos
  • Searched existing issues and docs

Expected behaviour

When executing echo.Start(), read the PORT(address) variable from an environment variable if the argument is not defined.

Actual behaviour

  • the function requires the address argument to be executed.
  • not reading environment variable.
// Start starts an HTTP server.
func (e *Echo) Start(address string) error {
	e.Server.Addr = address
	return e.StartServer(e.Server)
}

Version/commit

v4


I can create a pull request if necessary.

@imdatngo
Copy link

imdatngo commented May 7, 2019

I think this is too specific to be useful. e.Server is simply a *http.Server and it has quite a lot more configurations beside the Addr. I would prefer to keep Echo as simple as it is now, leave the specific stuffs for specific packages.

I that case, I would suggest to use caarlos0/env package for "read" the configuration from ENV vars and pass it to the e.Start()

@vishr
Copy link
Member

vishr commented Jun 9, 2019

I agree with @imdatngo. Closing it.

@vishr vishr closed this as completed Jun 9, 2019
@vishr vishr added the wontfix label Jun 9, 2019
@vishr vishr self-assigned this Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants