UNPKG

777 BJavaScriptView Raw
1module.exports = {
2
3 name: "<%=name%>",
4
5 label: "<%=label%>",
6
7 description: `<%=description%>`,
8
9 input: {
10 title: "<%=name%>",
11 type: "object",
12 properties: <%=input%>
13 },
14
15 output: {
16 title: "output",
17 type: "object",
18 properties: <%=output%>
19 },
20
21 execute: function(input, output){
22 var config = require("./config");
23 var request = require("request");
24 <%=requestOption%>
25 option.url = config.url+<%=uri%>;
26 request(option,function(error, response, body){
27 if (error) {
28 output(error);
29 }
30 output(null, body);
31 });
32 // to access auth info use input.auth , eg: input.auth.username
33 // and to return output use output callback like this output(null, { "notice" : "successful"})
34 // your code here
35 }
36}
37
\No newline at end of file