mirror of
https://github.com/eaper1980/oneapi2.git
synced 2026-06-04 10:13:52 +08:00
13 lines
273 B
Go
13 lines
273 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-contrib/cors"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func CORS() gin.HandlerFunc {
|
|
config := cors.DefaultConfig()
|
|
config.AllowOrigins = []string{"https://gin-template.vercel.app", "http://localhost:3000/"}
|
|
return cors.New(config)
|
|
}
|