Skip to content

Simple sample application that demonstrates how to consume Studio article publish messages

License

Notifications You must be signed in to change notification settings

WoodWing/studio-publish-channel-sample

Repository files navigation

Studio publication channel endpoint sample

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).

Configuration

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.

Install dependencies

npm install

Run endpoint

Run with the default port (3000):

npm run start

Or run on a custom port:

PORT=8888 npm run start

Put it online (ngrok)

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.

Channel installation

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.

Usage

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.

About

Simple sample application that demonstrates how to consume Studio article publish messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published