bff config to nacos
This commit is contained in:
+9
-2
@@ -10,6 +10,7 @@ import (
|
||||
"bff/internal/response"
|
||||
|
||||
"pkg.local/discovery"
|
||||
"pkg.local/utils"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/gateway"
|
||||
@@ -23,8 +24,14 @@ func main() {
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
|
||||
response.Init(c.Response.IsDebug, c.Response.EncryptKey)
|
||||
|
||||
// Nacos配置拉取初始化
|
||||
nacosParam := utils.NacosConfig{
|
||||
Hosts: c.Nacos.Hosts,
|
||||
NamespaceId: c.Nacos.NamespaceId,
|
||||
Group: c.Nacos.Group,
|
||||
ConfigID: c.Nacos.ConfigID,
|
||||
}
|
||||
utils.InitConfig(nacosParam)
|
||||
if err := discovery.Init(discovery.Config{
|
||||
Hosts: c.Nacos.Hosts,
|
||||
NamespaceId: c.Nacos.NamespaceId,
|
||||
|
||||
Reference in New Issue
Block a user