README
Amazon AWS SNS endpoint
sns-listen
handles incoming messages from AWS SNS
(Simple Notification Service).
It will automaticly confirms subscriptions and emit notifications.
Example
const snsListen = require('sns-listen')
const sns = snsListen()
sns.on('notification', (message) => {
console.log('got notification', message)
})
sns.on('subscribed', () => {
console.log('We are now subscribed')
})
sns.on('unsubscribed', () => {
console.log('Got UnsubscribeConfirmation')
})
sns.on('error', (err) => {
console.error('Something went wrong', err)
process.exit()
})
sns.listen(9000)
Use with Express
const express = require('express')
const snsListen = require('sns-listen')
const app = express()
app.post('/sns', snsListen((message) => {
console.log('got notification', message)
}))
app.listen(9000)
Install
npm install -S sns-listen
License
MIT