add cors
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"git.trj.tw/golang/go-gallery/modules/middleware"
|
||||
"git.trj.tw/golang/go-gallery/routers/account"
|
||||
"git.trj.tw/golang/go-gallery/routers/album"
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -14,6 +15,7 @@ func NewServ() *gin.Engine {
|
||||
r := gin.New()
|
||||
r.Use(gin.Logger())
|
||||
r.Use(gin.Recovery())
|
||||
r.Use(cors.Default())
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user