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:
HEROKU_APP_NAMEshould 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_URL are correctly set, you should see the event JSON string appearing on the browser screen, which looks like this: