Advertisement
Guest User

Nodered simple request log

a guest
Jan 12th, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.20 KB | None | 0 0
  1. [
  2. {
  3. "id": "fa6e50458ab28f21",
  4. "type": "http in",
  5. "z": "56e440dc8dd2ea6a",
  6. "name": "",
  7. "url": "/t",
  8. "method": "post",
  9. "upload": true,
  10. "swaggerDoc": "",
  11. "x": 680,
  12. "y": 560,
  13. "wires": [
  14. [
  15. "ba1ab5782646f971"
  16. ]
  17. ]
  18. },
  19. {
  20. "id": "4a02c0966170e3fc",
  21. "type": "http response",
  22. "z": "56e440dc8dd2ea6a",
  23. "name": "",
  24. "statusCode": "201",
  25. "headers": {},
  26. "x": 1470,
  27. "y": 620,
  28. "wires": []
  29. },
  30. {
  31. "id": "ba1ab5782646f971",
  32. "type": "function",
  33. "z": "56e440dc8dd2ea6a",
  34. "name": "store todo in todolist ",
  35. "func": "let something = msg.payload;\n\n\nsomething.data = something.data +1\n\n\nmsg.payload = {\n body: {\n sourceSummary: something.data,\n errorNumbers: \"errorNumbers\",\n missingNumbers: \"missingNumbers\"\n }\n};\n\nreturn msg;",
  36. "outputs": 1,
  37. "timeout": 0,
  38. "noerr": 0,
  39. "initialize": "",
  40. "finalize": "",
  41. "libs": [],
  42. "x": 980,
  43. "y": 560,
  44. "wires": [
  45. [
  46. "4a02c0966170e3fc",
  47. "79597d782ee66032",
  48. "6516b4a1d38676a7"
  49. ]
  50. ]
  51. },
  52. {
  53. "id": "c2f59bb1732d49d8",
  54. "type": "file in",
  55. "z": "56e440dc8dd2ea6a",
  56. "name": "",
  57. "filename": "/home/sites/nodeRed/logs/write6",
  58. "filenameType": "str",
  59. "format": "lines",
  60. "chunk": false,
  61. "sendError": false,
  62. "encoding": "none",
  63. "allProps": false,
  64. "x": 900,
  65. "y": 900,
  66. "wires": [
  67. [
  68. "dc396921c5364672"
  69. ]
  70. ]
  71. },
  72. {
  73. "id": "822be60b8271810d",
  74. "type": "inject",
  75. "z": "56e440dc8dd2ea6a",
  76. "name": "",
  77. "props": [
  78. {
  79. "p": "payload"
  80. },
  81. {
  82. "p": "topic",
  83. "vt": "str"
  84. }
  85. ],
  86. "repeat": "",
  87. "crontab": "",
  88. "once": false,
  89. "onceDelay": 0.1,
  90. "topic": "",
  91. "payload": "object",
  92. "payloadType": "date",
  93. "x": 630,
  94. "y": 900,
  95. "wires": [
  96. [
  97. "c2f59bb1732d49d8"
  98. ]
  99. ]
  100. },
  101. {
  102. "id": "b57ea6e955dbc53b",
  103. "type": "debug",
  104. "z": "56e440dc8dd2ea6a",
  105. "name": "debug 6",
  106. "active": true,
  107. "tosidebar": true,
  108. "console": false,
  109. "tostatus": false,
  110. "complete": "payload",
  111. "targetType": "msg",
  112. "statusVal": "",
  113. "statusType": "auto",
  114. "x": 1600,
  115. "y": 900,
  116. "wires": []
  117. },
  118. {
  119. "id": "e0bbe659bc92c364",
  120. "type": "file",
  121. "z": "56e440dc8dd2ea6a",
  122. "name": "",
  123. "filename": "/home/sites/nodeRed/logs/write6",
  124. "filenameType": "str",
  125. "appendNewline": true,
  126. "createDir": true,
  127. "overwriteFile": "false",
  128. "encoding": "none",
  129. "x": 1800,
  130. "y": 760,
  131. "wires": [
  132. []
  133. ]
  134. },
  135. {
  136. "id": "215b6255fe5b2316",
  137. "type": "split",
  138. "z": "56e440dc8dd2ea6a",
  139. "name": "",
  140. "splt": "\\n",
  141. "spltType": "str",
  142. "arraySplt": 1,
  143. "arraySpltType": "len",
  144. "stream": false,
  145. "addname": "",
  146. "property": "payload",
  147. "x": 1230,
  148. "y": 900,
  149. "wires": [
  150. [
  151. "aee634607ea0c4a0"
  152. ]
  153. ]
  154. },
  155. {
  156. "id": "5d72bfe8b1f6bf32",
  157. "type": "json",
  158. "z": "56e440dc8dd2ea6a",
  159. "name": "",
  160. "property": "payload",
  161. "action": "",
  162. "pretty": false,
  163. "x": 1470,
  164. "y": 900,
  165. "wires": [
  166. [
  167. "b57ea6e955dbc53b"
  168. ]
  169. ]
  170. },
  171. {
  172. "id": "aee634607ea0c4a0",
  173. "type": "switch",
  174. "z": "56e440dc8dd2ea6a",
  175. "name": "",
  176. "property": "payload",
  177. "propertyType": "msg",
  178. "rules": [
  179. {
  180. "t": "nempty"
  181. }
  182. ],
  183. "checkall": "true",
  184. "repair": false,
  185. "outputs": 1,
  186. "x": 1350,
  187. "y": 900,
  188. "wires": [
  189. [
  190. "5d72bfe8b1f6bf32"
  191. ]
  192. ]
  193. },
  194. {
  195. "id": "6516b4a1d38676a7",
  196. "type": "function",
  197. "z": "56e440dc8dd2ea6a",
  198. "name": "function 2",
  199. "func": "const timestamp = dateFormat(new Date(), \"yyyy-mm-dd h:MM:ss\");\nmsg.payload.time = timestamp;\nreturn msg;",
  200. "outputs": 1,
  201. "timeout": 0,
  202. "noerr": 0,
  203. "initialize": "",
  204. "finalize": "",
  205. "libs": [
  206. {
  207. "var": "dateFormat",
  208. "module": "dateformat"
  209. }
  210. ],
  211. "x": 1450,
  212. "y": 740,
  213. "wires": [
  214. [
  215. "e0bbe659bc92c364"
  216. ]
  217. ]
  218. },
  219. {
  220. "id": "dc396921c5364672",
  221. "type": "switch",
  222. "z": "56e440dc8dd2ea6a",
  223. "name": "",
  224. "property": "payload",
  225. "propertyType": "msg",
  226. "rules": [
  227. {
  228. "t": "tail",
  229. "v": "8",
  230. "vt": "num"
  231. }
  232. ],
  233. "checkall": "true",
  234. "repair": false,
  235. "outputs": 1,
  236. "x": 1110,
  237. "y": 900,
  238. "wires": [
  239. [
  240. "215b6255fe5b2316"
  241. ]
  242. ]
  243. },
  244. {
  245. "id": "79597d782ee66032",
  246. "type": "debug",
  247. "z": "56e440dc8dd2ea6a",
  248. "name": "debug 2",
  249. "active": true,
  250. "tosidebar": true,
  251. "console": false,
  252. "tostatus": false,
  253. "complete": "true",
  254. "targetType": "full",
  255. "statusVal": "",
  256. "statusType": "auto",
  257. "x": 1350,
  258. "y": 500,
  259. "wires": []
  260. }
  261. ]
Tags: nodered
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement