Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

feat: allow cors origin

Aldino Kemalc97e4a1e7b89
diff --git a/main.go b/main.go
index ba8e06be..38303676 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"github.com/aldinokemal/go-whatsapp-web-multidevice/services"
"github.com/aldinokemal/go-whatsapp-web-multidevice/utils"
"github.com/gofiber/fiber/v2"
+ "github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/logger"
"github.com/gofiber/template/html"
_ "github.com/mattn/go-sqlite3"
@@ -21,6 +22,10 @@ func main() {
app.Static("/statics", "./statics")
app.Use(middleware.Recovery())
app.Use(logger.New())
+ app.Use(cors.New(cors.Config{
+ AllowOrigins: "*",
+ AllowHeaders: "Origin, Content-Type, Accept",
+ }))
db := utils.InitWaDB()
cli := utils.InitWaCLI(db)