Skip to content

Commit

Permalink
get host from env
Browse files Browse the repository at this point in the history
  • Loading branch information
havardelnan committed Feb 12, 2025
1 parent e5585cc commit 0ca1a51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/apiconfig/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func InitViper() {
// Remove we dont set env in variables.
viper.SetDefault(configconsts.DEVELOPMENT, false)
//Remove used in gin.go
viper.SetDefault(configconsts.HTTP_HOST, "0.0.0.0")

Check failure on line 36 in internal/apiconfig/viper.go

View workflow job for this annotation

GitHub Actions / build-app

undefined: configconsts.HTTP_HOST
viper.SetDefault(configconsts.HTTP_PORT, "8080")
viper.SetDefault(configconsts.HTTP_TIMEOUT, "15s")

Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func InitHttpServer() {
}
_ = router.SetTrustedProxies([]string{"localhost"})
routes.SetupRoutes(router)
rlog.Fatal("router failing", router.Run(fmt.Sprintf("localhost:%s", viper.GetString(configconsts.HTTP_PORT))))
rlog.Fatal("router failing", router.Run(fmt.Sprintf("%s:%s", viper.GetString(configconsts.HTTP_HOST), viper.GetString(configconsts.HTTP_PORT))))
}

func headersMiddleware() gin.HandlerFunc {
Expand Down

0 comments on commit 0ca1a51

Please sign in to comment.