Sample app that runs a simple Node.js web server which consumes the AWS SNS publish messages triggered by Studio. When a publish message is received the article files are downloaded. This sample app shows how to properly handle SNS subscription and notification messages. It can be a starting point or inspiration for an integration between Studio and an actual destination channel (Web CMS, mobile App, etc).
Clone or download this repo. To develop and deploy the channel you need Node.js version 16 installed. It is recommended to install via nvm
or nvm-windows
.
npm install
Run with the default port (3000):
npm run start
Or run on a custom port:
PORT=8888 npm run start
Your endpoint need to be available to the internet, otherwise AWS cannot send messages to it. For a local development/test purposes you can use ngrok to achieve this.
You need to download ngrok and create an ngrok account. After that you can start the tunnel to your locally running endpoint:
ngrok http 3000
More information on how to use ngrok can be found in the ngrok documentation.
To actually use the channel you need to configure the channel as described in Studio documentation
The endpoint URL to use, is the URL created by ngrok, something like: https://<random-number>.ngrok.io
.
All default options for the channel can be used.
Publish one or multiple stories from Studio. After a few seconds the message will be handled by the running endpoint which will download the article files in the articles
folder.