This is a sample using MQTT
- install mosquitto from http://mosquitto.org/download/
- open a terminal window and navigate to where your cloned this repository
npm install
- open another terminal window
/usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
- go to first terminal window
cd src/server
node server.js
Open a terminal window and proceed with either of the scenarios. Keep the terminal window where node is running the server to see the stdout messages.
mosquitto_pub -t dc/email -m "get emailer ready"
mosquitto_pub -t dc/send-email -m '{"to": "<ENTER EMAIL ADDRESS>", "subject":"Test Email","text":"hello world"}'
mosquitto_pub -t dc/sms -m "get sms ready"
mosquitto_pub -t dc/send-sms -m '{"to":"<ENTER PHONE NUMBER>","text":"hello mobile"}'
mosquitto_pub -t dc/matt -m "hello world"
You need to ensure that you either have a wild card or using a specific topic.
mosquitto_sub -t dc/#