Package Exports
- sqsd-handler
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sqsd-handler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Introduction
sqsd-handler is Express middleware for handling SQS messages posted by the AWS ElasticBeanstalk worker-tier utility, SQSD.
Quick start
npm install sqsd-handler --saveThen:
var sqsdHandler = require("sqsd-handler");
var express = require("express");
var app = express();
var sqsdRouter = sqsdHandler.handle("/scheduled", function (msg) {
console.log("Catch-all handler received message", msg);
});
sqsdRouter.task("blue", function (msg) {
console.log("Scheduled task 'blue': ", msg);
});
sqsdRouter.task("red", function (msg) {
console.log("Scheduled task 'red': ", msg);
});
sqsdRouter.filter({"Type": "Notification"}, function (msg) {
console.log("Received SNS notification", msg.payload);
});
// Attach handler to Express app
app.use(sqsdRouter);
License
MIT.