JSPM

sqsd-handler

0.0.10
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23
  • Score
    100M100P100Q77150F
  • License MIT

Express middleware for handling SQS messages in AWS ElasticBeanstalk worker-tier apps.

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

Build Status

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 --save

Then:

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.