Skip to content

Instantly share code, notes, and snippets.

@dhartveld
Created June 29, 2015 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhartveld/263919512c0df2da7eea to your computer and use it in GitHub Desktop.
Save dhartveld/263919512c0df2da7eea to your computer and use it in GitHub Desktop.
Server Startup

A simple sub-flow that triggers once when the server first starts-up. The trigger sends an empty payload but has the topic 'server-startup' and has a msg.startupDate property.

[{"id":"bd88a321.42776","type":"subflow","name":"On Startup","in":[],"out":[{"x":454,"y":160,"wires":[{"id":"dbe754fd.2418a8","port":0}]}]},{"id":"c61021cd.39efe","type":"inject","name":"On Startup","topic":"server-startup","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":148,"y":160,"z":"bd88a321.42776","wires":[["dbe754fd.2418a8"]]},{"id":"dbe754fd.2418a8","type":"function","name":"Save startup date","func":"msg.startupDate = msg.payload;\nmsg.payload = \"\";\nreturn msg;","outputs":1,"noerr":0,"x":318,"y":160,"z":"bd88a321.42776","wires":[[]]},{"id":"5ca75d76.a358a4","type":"subflow:bd88a321.42776","name":"","x":261,"y":141,"z":"ba13aa9d.45ec58","wires":[["acf315a4.530ce8"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment