Web-1/Server state/Nodered-visitcount

Uit Inf2019
< Web-1‎ | Server state
Versie door Eelco (overleg | bijdragen) op 7 nov 2017 om 22:47
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen
[{"id":"fdaf7455.6ed7f8","type":"http in","z":"7bdbf80e.553dd8","name":"","url":"/count","method":"get","upload":false,"swaggerDoc":"","x":144.5,"y":121,"wires":[["7625db30.6f78e4"]]},{"id":"398df83d.d1b978","type":"template","z":"7bdbf80e.553dd8","name":"Show visitcount","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"This is visit number: {{visitcount}}!\n","output":"str","x":520,"y":120,"wires":[["d2a14e99.0397c"]]},{"id":"7625db30.6f78e4","type":"function","z":"7bdbf80e.553dd8","name":"visitcount","func":"var visits = flow.get(\"count\") || 0;\nvisits = visits + 1;\nflow.set(\"count\", visits);\nmsg.visitcount = visits;\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":120,"wires":[["398df83d.d1b978"]]},{"id":"d2a14e99.0397c","type":"http response","z":"7bdbf80e.553dd8","name":"","statusCode":"","headers":{},"x":690,"y":120,"wires":[]}]