changed CORS configuration
parent
df286787ba
commit
9281759baf
|
|
@ -1 +1,3 @@
|
|||
*.exe
|
||||
ncodingapi/ncodingapi
|
||||
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module ncodingapi
|
||||
|
||||
go 1.21.0
|
||||
go 1.20
|
||||
|
||||
require github.com/gofiber/fiber/v2 v2.48.0
|
||||
|
||||
|
|
|
|||
4
main.go
4
main.go
|
|
@ -10,13 +10,13 @@ func main() {
|
|||
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowHeaders: "Origin,Content-Type,Accept,Content-Length,Accept-Language,Accept-Encoding,Connection,Access-Control-Allow-Origin",
|
||||
AllowOrigins: "*",
|
||||
AllowOrigins: "http://*, https://*",
|
||||
AllowCredentials: true,
|
||||
AllowMethods: "GET,POST,HEAD,PUT,DELETE,PATCH,OPTIONS",
|
||||
}))
|
||||
|
||||
app.Get("/version", func(c *fiber.Ctx) error {
|
||||
return c.SendString("1.0.0")
|
||||
return c.SendString("1.0.1")
|
||||
})
|
||||
|
||||
app.Listen(":3800")
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue