From aca1314222790edfc9c0b4a32c0cfaabf21961d7 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 7 Jul 2024 07:57:23 -0700 Subject: [PATCH] added ApiServerAddress to config --- cmd/server.go | 2 +- internal/config/config.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/server.go b/cmd/server.go index 3675fc2..c365c38 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -13,7 +13,7 @@ func main() { ctx := context.Background() cfg := config.New() - apiClient := apiclient.New(cfg.ServerAddress) + apiClient := apiclient.New(cfg.ApiServerAddress) server := handlers.NewServer(ctx, cfg, apiClient) fmt.Println("The server is online and waiting for requests.") diff --git a/internal/config/config.go b/internal/config/config.go index 364bb2c..5967c87 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,8 +8,9 @@ import ( ) type Configs struct { - ServerAddress string - JwtSecret string + ServerAddress string + JwtSecret string + ApiServerAddress string } func New() Configs { @@ -20,8 +21,9 @@ func New() Configs { func getEnvConfig() Configs { return Configs{ - ServerAddress: os.Getenv("ServerAddress"), - JwtSecret: os.Getenv("JwtSecret"), + ServerAddress: os.Getenv("ServerAddress"), + JwtSecret: os.Getenv("JwtSecret"), + ApiServerAddress: os.Getenv("ApiServerAddress"), } }