@apidaze/node-red-contrib-apidaze
Version:
Node-RED module for Apidaze
54 lines (49 loc) • 1.34 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('webhook', {
category: 'apidaze',
color: '#E9967A',
defaults: {
account: {
value: '',
type: 'config',
label: 'Account',
},
path: {
value: '',
required: true,
},
},
inputs: 0,
outputs: 1,
icon: 'font-awesome/fa-anchor',
label: function () {
let root = RED.settings.httpNodeRoot;
if (root.slice(-1) != '/') {
root = root + '/';
}
if (this.path.charAt(0) == '/') {
root += this.path.slice(1);
} else {
root += this.path;
}
return `[webhook] ${root}`;
},
labelStyle: function () {
return this.name ? 'node_label_italic' : '';
},
});
</script>
<script type="text/html" data-template-name="webhook">
<div class="form-row">
<label for="node-input-account"><i class="fa fa-user"></i> Account</label>
<input type="text" id="node-input-account" />
</div>
<div class="form-row">
<label for="node-input-path"><i class="fa fa-user"></i> Path</label>
<input type="text" id="node-input-path" />
</div>
<input type="hidden" id="node-input-outputs" />
</script>
<script type="text/html" data-help-name="webhook">
<p>Creates a GET/POST route to handle apidaze requests</p>
</script>