新增自定义的 Cors

This commit is contained in:
eson
2023-07-11 19:43:46 +08:00
parent e0de8bfcf2
commit a4f429a528
17 changed files with 88 additions and 21 deletions

View File

@@ -15,7 +15,9 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()
ctx := svc.NewServiceContext(c)