-
Notifications
You must be signed in to change notification settings - Fork 0
/
x.json
115 lines (115 loc) · 2.85 KB
/
x.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"name": "http",
"description": "HTTP nodes for Chiχ",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "https://github.com/nodule/http.git"
},
"dependencies": {
"request": "2.9.x"
},
"nodes": [
{
"name": "createServer",
"ns": "http",
"description": "Create HTTP Server",
"phrases": {
"active": "Creating HTTP Server"
},
"ports": {
"input": {},
"output": {
"out": {
"title": "Out",
"type": "function"
},
"http": {
"title": "Server",
"type": "Server"
}
}
},
"dependencies": {
"npm": {
"http": "internal"
}
},
"fn": "output = function () {\n var _http = http.createServer(function httpRequest (req, res) {\n cb({\n out: $.create({request: req, response: res})\n });\n });\n\n cb({\n http: $.create(_http)\n });\n};\n"
},
{
"name": "listen",
"ns": "http",
"async": true,
"description": "HTTP Listen",
"phrases": {
"active": "HTTP Listening on {{input.host}}:{{input.port}}"
},
"ports": {
"input": {
"http": {
"title": "Server",
"type": "Server",
"async": true,
"required": true
},
"port": {
"title": "Port",
"type": "string",
"default": "8080"
},
"host": {
"title": "Host",
"type": "string",
"default": "0.0.0.0"
}
},
"output": {
"http": {
"title": "Server",
"type": "Server"
}
}
},
"fn": "on.input.http = function () {\n state.http = $.http.listen($.port, $.host);\n output({\n http: $.create(state.http)\n });\n};\n\non.shutdown = function () {\n if (state.http) {\n state.http.close();\n }\n};\n"
},
{
"name": "request",
"ns": "http",
"description": "http request",
"phrases": {
"active": "Performing HTTP request to {{input.url}}"
},
"ports": {
"input": {
"url": {
"title": "Url Request",
"type": "string",
"format": "url",
"description": "The url to be requested."
}
},
"output": {
"error": {
"title": "Error",
"type": "object"
},
"res": {
"title": "Stream",
"type": "Stream"
},
"body": {
"title": "Body",
"type": "string"
}
}
},
"dependencies": {
"npm": {
"request": "2.9.x"
}
},
"fn": "var obj = {};\nobj.request = request;\noutput = [obj, 'request', $.url]\n"
}
]
}