Documentacion con Bruno, los eventos se redirigen
This commit is contained in:
16
API-MOCK-SHOPIFY/Health.bru
Normal file
16
API-MOCK-SHOPIFY/Health.bru
Normal file
@@ -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
|
||||||
|
}
|
||||||
23
API-MOCK-SHOPIFY/Webhooks/Launch Order.bru
Normal file
23
API-MOCK-SHOPIFY/Webhooks/Launch Order.bru
Normal file
@@ -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
|
||||||
|
}
|
||||||
26
API-MOCK-SHOPIFY/Webhooks/Subscribe To.bru
Normal file
26
API-MOCK-SHOPIFY/Webhooks/Subscribe To.bru
Normal file
@@ -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
|
||||||
|
}
|
||||||
8
API-MOCK-SHOPIFY/Webhooks/folder.bru
Normal file
8
API-MOCK-SHOPIFY/Webhooks/folder.bru
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
meta {
|
||||||
|
name: Webhooks
|
||||||
|
seq: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
auth {
|
||||||
|
mode: inherit
|
||||||
|
}
|
||||||
15
API-MOCK-SHOPIFY/bruno.json
Normal file
15
API-MOCK-SHOPIFY/bruno.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
API-MOCK-SHOPIFY/collection.bru
Normal file
0
API-MOCK-SHOPIFY/collection.bru
Normal file
4
API-MOCK-SHOPIFY/environments/Desarrollo.bru
Normal file
4
API-MOCK-SHOPIFY/environments/Desarrollo.bru
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
vars {
|
||||||
|
host: http://localhost
|
||||||
|
port: 3300
|
||||||
|
}
|
||||||
@@ -118,6 +118,7 @@ export class SubscriptionManager {
|
|||||||
request.on("error", () => console.error)
|
request.on("error", () => console.error)
|
||||||
|
|
||||||
request.end()
|
request.end()
|
||||||
|
console.debug("Enviado evento a ", sub.host, ":", sub.port, sub.endpoint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user