diff --git a/goctl_template/api/main.tpl b/goctl_template/api/main.tpl index 4a7983e0..5d1a8518 100644 --- a/goctl_template/api/main.tpl +++ b/goctl_template/api/main.tpl @@ -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) diff --git a/goctl_template_backend/api/main.tpl b/goctl_template_backend/api/main.tpl index 709ddbd1..a90d8dfc 100644 --- a/goctl_template_backend/api/main.tpl +++ b/goctl_template_backend/api/main.tpl @@ -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) diff --git a/server/backend/backend.go b/server/backend/backend.go index ff692e55..561ac8b6 100644 --- a/server/backend/backend.go +++ b/server/backend/backend.go @@ -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) diff --git a/server/canteen/canteen.go b/server/canteen/canteen.go index 117183e1..b252e60b 100644 --- a/server/canteen/canteen.go +++ b/server/canteen/canteen.go @@ -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) diff --git a/server/data-transfer/data-transfer.go b/server/data-transfer/data-transfer.go index b4508d2d..45b8540d 100644 --- a/server/data-transfer/data-transfer.go +++ b/server/data-transfer/data-transfer.go @@ -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) diff --git a/server/home-user-auth/home-user-auth.go b/server/home-user-auth/home-user-auth.go index 7e44ddff..4edb9474 100644 --- a/server/home-user-auth/home-user-auth.go +++ b/server/home-user-auth/home-user-auth.go @@ -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) diff --git a/server/inventory/inventory.go b/server/inventory/inventory.go index 576f18d6..2b2af176 100644 --- a/server/inventory/inventory.go +++ b/server/inventory/inventory.go @@ -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) diff --git a/server/map-library/map-library.go b/server/map-library/map-library.go index 823fe54d..6958ce1c 100644 --- a/server/map-library/map-library.go +++ b/server/map-library/map-library.go @@ -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) diff --git a/server/orders/orders.go b/server/orders/orders.go index b8ae8605..01a2ad6d 100644 --- a/server/orders/orders.go +++ b/server/orders/orders.go @@ -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) diff --git a/server/product-model/product-model.go b/server/product-model/product-model.go index 85d3cbbf..06ee4752 100644 --- a/server/product-model/product-model.go +++ b/server/product-model/product-model.go @@ -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) diff --git a/server/product-template/product-template.go b/server/product-template/product-template.go index 7218da3e..db5296e8 100644 --- a/server/product-template/product-template.go +++ b/server/product-template/product-template.go @@ -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) diff --git a/server/product/product.go b/server/product/product.go index 0c583a1c..d2082584 100644 --- a/server/product/product.go +++ b/server/product/product.go @@ -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) diff --git a/server/shopping-cart-confirmation/shopping-cart-confirmation.go b/server/shopping-cart-confirmation/shopping-cart-confirmation.go index 9b27d7b5..f621aaa3 100644 --- a/server/shopping-cart-confirmation/shopping-cart-confirmation.go +++ b/server/shopping-cart-confirmation/shopping-cart-confirmation.go @@ -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) diff --git a/server/upload/upload.go b/server/upload/upload.go index ed185b9c..48e5f663 100644 --- a/server/upload/upload.go +++ b/server/upload/upload.go @@ -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) diff --git a/server/webset/wetset.go b/server/webset/wetset.go index 196bbd76..700cf37c 100644 --- a/server/webset/wetset.go +++ b/server/webset/wetset.go @@ -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)