Files
message-pusher/middleware/cors.go
T

13 lines
273 B
Go
Raw Normal View History

2022-11-11 15:35:02 +08:00
package middleware
import (
2022-11-22 11:04:06 +08:00
"github.com/gin-contrib/cors"
2022-11-11 15:35:02 +08:00
"github.com/gin-gonic/gin"
)
func CORS() gin.HandlerFunc {
config := cors.DefaultConfig()
2022-11-22 11:04:06 +08:00
config.AllowOrigins = []string{"https://gin-template.vercel.app", "http://localhost:3000/"}
2022-11-11 15:35:02 +08:00
return cors.New(config)
}