[+] добавил cors
This commit is contained in:
parent
d3b3d3c870
commit
763a38e157
@ -5,6 +5,7 @@ import (
|
||||
"jwt_service/internal/routes"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -12,6 +13,11 @@ func main() {
|
||||
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowCredentials: true,
|
||||
AllowOrigins: "http://127.0.0.1", //Very important while using a HTTPonly Cookie, frontend can easily get and return back the cookie.
|
||||
}))
|
||||
|
||||
routes.Setup(app)
|
||||
|
||||
app.Listen(":8000")
|
||||
|
Loading…
Reference in New Issue
Block a user