Guest User

Web Node-Red

a guest
Apr 18th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.75 KB | None | 0 0
  1. [{"id":"8f1120ba.93ba4","type":"template","z":"b1df3b9f.69ab28","name":"format html page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<h1>Drinks available on : {{payload.day}}</h1>\n\n<ul>\n{{#payload.drinks}}\n<li>{{drink}}</li>    \n{{/payload.drinks}}\n</ul>\n\n<h3>Specials:</h3> \n<hr>\n<ul>\n{{^payload.specials}}\nNone today, sorry      \n{{/payload.specials}}\n\n{{#payload.specials}}\n<li>{{drink}}</li>\n{{/payload.specials}}\n</ul>","x":450,"y":100,"wires":[["5c480bb0.c11a44"]]},{"id":"8a4a16f1.58bb78","type":"function","z":"b1df3b9f.69ab28","name":"Drinks","func":"msg.payload =   \n         {'day':'Monday',\n          'drinks':[{'drink': 'coffee'}, \n                    {'drink': 'tea'}, \n                    {'drink': 'orange juice'}]\n         };\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":80,"wires":[["8f1120ba.93ba4"]]},{"id":"843e9b05.f90ce8","type":"function","z":"b1df3b9f.69ab28","name":"Specials","func":"msg.payload = \n         {'day':'Monday',\n          'drinks':[{'drink': 'coffee'}, \n                    {'drink': 'tea'}, \n                    {'drink': 'orange juice'}],\n          'specials':[{'drink': 'hot chocolate'}, \n                      {'drink': 'espresso'}]\n         };\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":120,"wires":[["8f1120ba.93ba4"]]},{"id":"a546b0ae.528f","type":"http in","z":"b1df3b9f.69ab28","name":"網頁目錄","url":"/menu","method":"get","swaggerDoc":"","x":100,"y":80,"wires":[["8a4a16f1.58bb78"]]},{"id":"abd93ef3.cc6ca","type":"http response","z":"b1df3b9f.69ab28","name":"","x":790,"y":100,"wires":[]},{"id":"2075962e.5f3b7a","type":"http in","z":"b1df3b9f.69ab28","name":"/specials","url":"/specials","method":"get","swaggerDoc":"","x":100,"y":120,"wires":[["843e9b05.f90ce8"]]},{"id":"5c480bb0.c11a44","type":"function","z":"b1df3b9f.69ab28","name":"setHTTPheader","func":"// If sending JSON data the content type is:\n//msg.headers={\"Content-Type\":\"application/json\"}\n\n// For HTML use the content type line below:\nmsg.headers={\"Content-Type\":\"text/html\"}\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":100,"wires":[["abd93ef3.cc6ca"]]},{"id":"6b214ee4.525a4","type":"http in","z":"b1df3b9f.69ab28","name":"/test","url":"/test","method":"get","swaggerDoc":"","x":90,"y":220,"wires":[["a5d2493d.7417a8"]]},{"id":"a5d2493d.7417a8","type":"function","z":"b1df3b9f.69ab28","name":"","func":"msg.payload=\" Hello 歡迎來到Node-Red 你將擁有無限的可能 \";\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":220,"wires":[["437de5e5.6cd95c"]]},{"id":"437de5e5.6cd95c","type":"http response","z":"b1df3b9f.69ab28","name":"","x":484,"y":220,"wires":[]},{"id":"c3b1ceb5.cffa4","type":"comment","z":"b1df3b9f.69ab28","name":"Web建立測試","info":"","x":110,"y":180,"wires":[]}]
Advertisement
Add Comment
Please, Sign In to add comment