nacos config

This commit is contained in:
eson
2023-09-19 11:41:38 +08:00
parent d7f94f0da9
commit b4672bbed7
29 changed files with 208 additions and 124 deletions

View File

@@ -9,6 +9,7 @@ import (
"fusenapi/server/upload/internal/handler"
"fusenapi/server/upload/internal/svc"
"fusenapi/utils/auth"
"fusenapi/utils/fsconfig"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/rest"
@@ -19,8 +20,9 @@ var configFile = flag.String("f", "etc/upload.yaml", "the config file")
func main() {
flag.Parse()
cfgContent := fsconfig.StartNacosConfig(*configFile, nil)
var c config.Config
conf.MustLoad(*configFile, &c)
conf.LoadConfigFromYamlBytes([]byte(cfgContent), &c)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {