添加跨域名

This commit is contained in:
eson 2023-07-10 17:07:29 +08:00
parent f5b3fedee3
commit e16222849c
15 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -19,7 +19,7 @@ func main() {
var c config2.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc2.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)
handler.RegisterHandlers(server, ctx)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)

View File

@ -20,7 +20,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
server := rest.MustNewServer(c.RestConf, rest.WithCors())
defer server.Stop()
ctx := svc.NewServiceContext(c)