Last active
April 3, 2016 02:26
-
-
Save rturk/01a2d43da94bb5290d7a8c7b332a2a79 to your computer and use it in GitHub Desktop.
Revisions
-
rturk revised this gist
Apr 3, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ /** * Sends a Message to AWS topic */ import AWS from 'aws-sdk'; -
rturk created this gist
Apr 3, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ /** * Middleware that log Koa errors to AWS SNS topic. */ import AWS from 'aws-sdk'; const message = { test: "Test Message", error: "Error test", }; var sns = new AWS.SNS({params: {TopicArn: 'arn:aws:sns:us-east-1:096957576271:brandlovers-server-error'}}); console.log('sending log message to SNS'); sns.publish({ Message: JSON.stringify(message), MessageStructure: 'json', }, function(err, data) { if (err) { console.log(err.stack); return; } });