File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func RunServer() int {
5050 startJobs (ctx )
5151
5252 e := routes (web .New ())
53- go e .Start (":" + env .Config .Port )
53+ go e .Start (env . Config . Host + ":" + env .Config .Port )
5454 return listenSignals (e )
5555}
5656
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ type config struct {
4848 IdleTimeout time.Duration `env:"HTTP_IDLE_TIMEOUT,default=120s,strict"`
4949 }
5050 Port string `env:"PORT,default=3000"`
51+ Host string `env:"HOST,default="`
5152 HostMode string `env:"HOST_MODE,default=single"`
5253 HostDomain string `env:"HOST_DOMAIN"`
5354 BaseURL string `env:"BASE_URL"`
@@ -66,6 +67,7 @@ type config struct {
6667 Metrics struct {
6768 Enabled bool `env:"METRICS_ENABLED,default=false"`
6869 Port string `env:"METRICS_PORT,default=4000"`
70+ Host string `env:"METRICS_HOST,default="`
6971 }
7072 Database struct {
7173 URL string `env:"DATABASE_URL,required"`
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ func (e *Engine) Start(address string) {
128128 }
129129
130130 if env .Config .Metrics .Enabled {
131- metricsAddress := ":" + env .Config .Metrics .Port
131+ metricsAddress := env . Config . Metrics . Host + ":" + env .Config .Metrics .Port
132132 e .metricsServer = newMetricsServer (metricsAddress )
133133 go func () {
134134 err := e .metricsServer .ListenAndServe ()
You can’t perform that action at this time.
0 commit comments