diff --git a/internal/pkg/bootstrap/bootstrap.go b/internal/pkg/bootstrap/bootstrap.go index 3a105be7..4841bb71 100644 --- a/internal/pkg/bootstrap/bootstrap.go +++ b/internal/pkg/bootstrap/bootstrap.go @@ -40,6 +40,7 @@ type infraConfig struct { HTTPPort string `json:"http_port"` MqttURL string `json:"mqtt_url"` EdgexURL string `json:"edgex_url"` + NatsURL string `json:"nats_url"` } // Bootstrap - Retrieve device config @@ -91,7 +92,11 @@ func Bootstrap(cfg Config, logger log.Logger, file string) error { dataChan = dc.MainfluxChannels[0].ID } - sc := config.ServerConf{Port: ic.HTTPPort} + sc := config.ServerConf{ + Port: ic.HTTPPort, + NatsURL: ic.NatsURL, + } + tc := config.ThingConf{ ID: dc.MainfluxID, Key: dc.MainfluxKey, diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 2ac97dfd..562c73bd 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -11,7 +11,8 @@ import ( ) type ServerConf struct { - Port string `toml:"port"` + Port string `toml:"port"` + NatsURL string `toml:"nats_url"` } type ThingConf struct {