a cors-header middleware for goa(https://github.com/goadesign/goa)
-
first, import this from glide, or
go get github.com/deadcheat/goacors
-
write your main.go generated automatically from goagen.
service.Use(goacors.WithConfig(service, &DefaultGoaCORSConfig))
or
service.Use(goacors.WithConfig(service, &goacors.GoaCORSConfig{ AllowOrigins: []string{"http://example.com"}, AllowMethods: []string{goacors.GET}, })) ```