2023-04-22 12:39:27 +00:00
|
|
|
package middleware
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-contrib/cors"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func CORS() gin.HandlerFunc {
|
|
|
|
config := cors.DefaultConfig()
|
2023-04-22 13:14:09 +00:00
|
|
|
config.AllowOrigins = []string{"https://one-api.vercel.app", "http://localhost:3000/"}
|
2023-04-22 12:39:27 +00:00
|
|
|
return cors.New(config)
|
|
|
|
}
|