chore: move conf package

This commit is contained in:
Noah Hsu
2022-06-25 20:38:02 +08:00
parent 7dadab95b2
commit 306b90399c
18 changed files with 91 additions and 33 deletions

View File

@ -0,0 +1 @@
package controllers

View File

@ -1 +1,17 @@
package server
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func Init(r *gin.Engine) {
Cors(r)
}
func Cors(r *gin.Engine) {
config := cors.DefaultConfig()
config.AllowAllOrigins = true
config.AllowHeaders = append(config.AllowHeaders, "Authorization", "range")
r.Use(cors.New(config))
}