Fela Maslen 5 anos atrás
pai
commit
ebb70927e6

+ 6 - 6
gmus-backend/pkg/config/config.go

@@ -131,12 +131,12 @@ func getRedisUrl() string {
 }
 
 func getAllowedOrigins() []string {
-  origins, hasOrigins := os.LookupEnv("ALLOWED_ORIGINS")
-  if !hasOrigins {
-    return []string{"*"}
-  }
+	origins, hasOrigins := os.LookupEnv("ALLOWED_ORIGINS")
+	if !hasOrigins {
+		return []string{"*"}
+	}
 
-  return strings.Split(origins, ",")
+	return strings.Split(origins, ",")
 }
 
 type config struct {
@@ -146,5 +146,5 @@ type config struct {
 	Host             string
 	Port             int
 	RedisUrl         string
-  AllowedOrigins []string
+	AllowedOrigins   []string
 }

+ 1 - 1
gmus-backend/pkg/config/main.go

@@ -14,6 +14,6 @@ func GetConfig() config {
 		Host:             getListenHost(),
 		Port:             getPort(),
 		RedisUrl:         getRedisUrl(),
-    AllowedOrigins: getAllowedOrigins(),
+		AllowedOrigins:   getAllowedOrigins(),
 	}
 }

+ 3 - 3
gmus-backend/pkg/server/server.go

@@ -40,9 +40,9 @@ func StartServer() {
 	port := conf.Port
 
 	handler := cors.New(cors.Options{
-    AllowedOrigins: conf.AllowedOrigins,
-    AllowCredentials: true,
-  }).Handler(router)
+		AllowedOrigins:   conf.AllowedOrigins,
+		AllowCredentials: true,
+	}).Handler(router)
 
 	l.Info("Starting server on %s:%d\n", conf.Host, port)
 	log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", conf.Host, port), handler))