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

@@ -6,6 +6,7 @@ import (
"net/http"
"fusenapi/utils/auth"
"fusenapi/utils/fsconfig"
"fusenapi/server/resource/internal/config"
"fusenapi/server/resource/internal/handler"
@@ -20,8 +21,10 @@ var configFile = flag.String("f", "etc/resource.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) {
}))
defer server.Stop()