From 9f7b29c1ec990e2c39e0facd9b2493117e1d1103 Mon Sep 17 00:00:00 2001 From: Nilo Roberto C Paim Date: Sun, 15 Oct 2023 09:20:58 -0300 Subject: [PATCH] added first version of wix integration --- controllers/authController.go | 4 +++- infra/Caddyfile | 8 -------- infra/api.service | 3 +-- infra/{apihomolog.service => apih.service} | 5 ++--- infra/newapi-homolog.sh | 4 ---- infra/newapi.sh | 4 ---- 6 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 infra/Caddyfile rename infra/{apihomolog.service => apih.service} (54%) delete mode 100644 infra/newapi-homolog.sh delete mode 100644 infra/newapi.sh diff --git a/controllers/authController.go b/controllers/authController.go index 3a9d3d4..9ec959a 100644 --- a/controllers/authController.go +++ b/controllers/authController.go @@ -183,12 +183,14 @@ func GetAllUsers(c *fiber.Ctx) error { } func WixIntegration(c *fiber.Ctx) error { - var data map[string]string + var data map[string]interface{} if err := c.BodyParser(&data); err != nil { return fiber.ErrBadRequest } + log.Printf("====================> Data from WIX: %v\n", data) + utils.PrettyPrintJson(data) return c.JSON(data) diff --git a/infra/Caddyfile b/infra/Caddyfile deleted file mode 100644 index 1daa984..0000000 --- a/infra/Caddyfile +++ /dev/null @@ -1,8 +0,0 @@ -http://www.pcastt.com.br, http://pcastt.com.br, https://www.pcastt.com.br, https://pcastt.com.br { - root * /root/sites/pcastt - file_server - - handle_path /api/* { - reverse_proxy localhost:8111 - } -} diff --git a/infra/api.service b/infra/api.service index 77379bd..fdc9be1 100644 --- a/infra/api.service +++ b/infra/api.service @@ -4,8 +4,7 @@ After=multi-user.target [Service] WorkingDirectory=/root/api -# RootDirectory=/root/api-homolog -ExecStart=/root/api/api +ExecStart=/root/api/api prod Type=simple [Install] diff --git a/infra/apihomolog.service b/infra/apih.service similarity index 54% rename from infra/apihomolog.service rename to infra/apih.service index 70d8759..e49891d 100644 --- a/infra/apihomolog.service +++ b/infra/apih.service @@ -3,9 +3,8 @@ Description=Pcast Homolog API After=multi-user.target [Service] -WorkingDirectory=/root/api-homolog -# RootDirectory=/root/api-homolog -ExecStart=/root/api-homolog/api +WorkingDirectory=/root/api +ExecStart=/root/api/api homolog Type=simple [Install] diff --git a/infra/newapi-homolog.sh b/infra/newapi-homolog.sh deleted file mode 100644 index 157ca26..0000000 --- a/infra/newapi-homolog.sh +++ /dev/null @@ -1,4 +0,0 @@ -service apihomolog stop -cp /home/ftpuser/ftp/files/api /root/api-homolog -chmod 777 api -service apihomolog start diff --git a/infra/newapi.sh b/infra/newapi.sh deleted file mode 100644 index 46bd5b8..0000000 --- a/infra/newapi.sh +++ /dev/null @@ -1,4 +0,0 @@ -service api stop -cp /home/ftpuser/ftp/files/api /root/api -chmod 777 /root/api/api -service api start