diff --git a/API-MOCK-SHOPIFY/Health.bru b/API-MOCK-SHOPIFY/Health.bru new file mode 100644 index 0000000..fda8930 --- /dev/null +++ b/API-MOCK-SHOPIFY/Health.bru @@ -0,0 +1,16 @@ +meta { + name: Health + type: http + seq: 1 +} + +get { + url: {{host}}:3300/health + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/API-MOCK-SHOPIFY/Webhooks/Launch Order.bru b/API-MOCK-SHOPIFY/Webhooks/Launch Order.bru new file mode 100644 index 0000000..39f1047 --- /dev/null +++ b/API-MOCK-SHOPIFY/Webhooks/Launch Order.bru @@ -0,0 +1,23 @@ +meta { + name: Launch Order + type: http + seq: 2 +} + +post { + url: {{host}}:{{port}}/webhooks/shopify/orders + body: json + auth: inherit +} + +body:json { + { + "topic":"orders/create", + "id":"1234" + } +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/API-MOCK-SHOPIFY/Webhooks/Subscribe To.bru b/API-MOCK-SHOPIFY/Webhooks/Subscribe To.bru new file mode 100644 index 0000000..ababb2d --- /dev/null +++ b/API-MOCK-SHOPIFY/Webhooks/Subscribe To.bru @@ -0,0 +1,26 @@ +meta { + name: Subscribe To + type: http + seq: 1 +} + +post { + url: {{host}}:{{port}}/webhooks/subto + body: json + auth: inherit +} + +body:json { + { + "host": "http://localhost", + "port": "3000", + "endpoint": "/test2", + "method": "POST", + "topic": "orders/create" + } +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/API-MOCK-SHOPIFY/Webhooks/folder.bru b/API-MOCK-SHOPIFY/Webhooks/folder.bru new file mode 100644 index 0000000..e8f833b --- /dev/null +++ b/API-MOCK-SHOPIFY/Webhooks/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Webhooks + seq: 2 +} + +auth { + mode: inherit +} diff --git a/API-MOCK-SHOPIFY/bruno.json b/API-MOCK-SHOPIFY/bruno.json new file mode 100644 index 0000000..9b19929 --- /dev/null +++ b/API-MOCK-SHOPIFY/bruno.json @@ -0,0 +1,15 @@ +{ + "version": "1", + "name": "API-MOCK-SHOPIFY", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ], + "size": 0, + "filesCount": 0, + "presets": { + "requestType": "http", + "requestUrl": "localhost:3300" + } +} \ No newline at end of file diff --git a/API-MOCK-SHOPIFY/collection.bru b/API-MOCK-SHOPIFY/collection.bru new file mode 100644 index 0000000..e69de29 diff --git a/API-MOCK-SHOPIFY/environments/Desarrollo.bru b/API-MOCK-SHOPIFY/environments/Desarrollo.bru new file mode 100644 index 0000000..fa95ce2 --- /dev/null +++ b/API-MOCK-SHOPIFY/environments/Desarrollo.bru @@ -0,0 +1,4 @@ +vars { + host: http://localhost + port: 3300 +} diff --git a/src/controllers/subscriptions.ts b/src/controllers/subscriptions.ts index f58f99f..a9cc470 100644 --- a/src/controllers/subscriptions.ts +++ b/src/controllers/subscriptions.ts @@ -118,6 +118,7 @@ export class SubscriptionManager { request.on("error", () => console.error) request.end() + console.debug("Enviado evento a ", sub.host, ":", sub.port, sub.endpoint) } } }