Sails Persistence SNS
Automatically stream all Sails model persistence events to an SNS topic
Install
npm install --save sails-persistence-sns
Use
To use Sails Persistence SNS out of the box add the streamer to config/models.js
default persistence hooks so it looks like the following example:
var sailsPersistenceSns = ; moduleexportsmodels = { sailsPersistenceSns; } { sailsPersistenceSns; } { sailsPersistenceSns; };
API
require('sails-persistence-sns')(options: Object)
Initializes Sails Persistence SNS with the given options. All options are optional.
options.snsTopicArn
: SNS topic ARN (must exist already)options.region
: (default: us-east-1) AWS regionoptions.logger
: Log4js compatible logger which Sails Persistence SNS will use (set tonull
for no logging)