Closed rafaelhenrique closed 5 years ago
This looks good @rafaelhenrique 😄 🎉
Just a few suggestions to make this ready for merge:
required
flag to enforce that both the variables are set. 👏 PORT
(say 8080) which can be simply set using the default
tag.desc
tag for each of the variables.Config
struct in common
package and import it in server.go
.if err := envconfig.Process("hercules", &config); err != nil {
fmt.Fprintln(os.Stderr, err)
envconfig.Usage("hercules", &config)
os.Exit(1)
}
Applied changes @kshitij10496 @hypnoglow ... thanks for your tips :wink:
Great work @rafaelhenrique! 🎉
I will wait for @hypnoglow's review before merging it in. 😄
Thanks, @rafaelhenrique, and @hypnoglow for your invaluable contributions! 🎉 🤗
:tada:
UPDATE:
I deployed the changes to Heroku only to later realise that the platform sets the PORT
environment variable for each application. What this means is that it won't update the new HERCULES_PORT
variable. Thus, I had to force the envconfig
to recognize PORT
and read it's value into config.Port
variable. 😅
I will try to be more aware of these subtleties in the future.
Trying solve issue #6 :smile: