Custom request handler function.
Get the holdResponse flag.
Set hold response flag. This allows you to run tunnel logic and send the response after completion. You must call releaseResponse later if you use this.
Creates a new job
Get the custom handleRequest function.
Get the HTTP method.
Get the interface manager. Used to manage interface instances for session handling.
Get the name.
Get the path.
On load, do nothing.
Releases the webhook response when tunnel run logic is complete.
The webhook job that triggered the webhook nest.
The optional response message, if not using a custom request handler.
var webhook = af.createWebhookNest(["jobs", "submit"], "post");
webhook.holdResponse = true; // Keeps the response from being sent immediately
var tunnel = af.createTunnel("Dwight's test tunnel");
tunnel.watch(webhook);
tunnel.run(function(job, nest){
setTimeout(function(){
nest.releaseResponse(job, "Worked!"); // Sends response
}, 1500); // After 1.5 seconds
});
Set the custom handlerRequest function.
Set the HTTP method.
Set the path as a string or a string array. All parts are URI encoded. Create directory structures with an array: ["one", "two"] results in "/one/two".
Add webhook to server watch list.
Generated using TypeDoc
Webhook Nest constructor