GitHub Readme.md
This is a small sample webhooks handler for a MODE project.
If you don't know how webhooks for MODE work, please refer to this doc.
You can launch this sample webhooks handler on Heroku by following these steps:
https://HEROKU_APP_NAME.herokuapp.com/evt
, where HEROKU_APP_NAME
should be replaced by a unique app name in the Heroku namespace.EVENT_KEY
(event webhook key) and EVENT_URL
(event webhook URL). You can get these from the Smart Module settings page on the MODE console.After launching the Heroku app, open the app's URL on your browser. You will see the message: No device event.
It means the code is running. Now, you can send an event from a device, or from the Device Simulator. If EVENT_KEY
and EVENT_URL
are correctly set, you should see the event JSON string appearing on the browser screen, which looks like this:
{"homeId":173,"timestamp":"2016-01-04T23:26:09.521Z","eventType":"abc","eventData":{},"originDeviceId":260}