refact(controller): api cors print info identation

This commit is contained in:
leandrofars 2023-10-25 01:02:01 -03:00
parent fb25839045
commit c26cf8ebd0

View File

@ -1,16 +1,17 @@
package cors
import (
"github.com/rs/cors"
"log"
"net/http"
"os"
"strings"
"fmt"
"github.com/rs/cors"
)
func GetCorsConfig() cors.Cors {
allowedOrigins := getCorsEnvConfig()
fmt.Println(allowedOrigins)
log.Println("API CORS - AllowedOrigins:", allowedOrigins)
return *cors.New(cors.Options{
AllowedOrigins: allowedOrigins,
AllowedMethods: []string{
@ -35,4 +36,4 @@ func getCorsEnvConfig() []string {
return []string{"*"}
}
return strings.Split(val, ",")
}
}