esv
express-sns-validator
npm i express-sns-validator
esv

express-sns-validator

ExpressJS middleware for verifying Amazon SNS notifications using sns-validator

by Jonathon Hill

1.1.2 (see all)License:MITTypeScript:Not Found
npm i express-sns-validator
Readme

express-sns-validator

Build Status Dependency Status Download Status Sponsor on GitHub

ExpressJS middleware for verifying Amazon SNS notifications using sns-validator (no dependency on the AWS SDK).

Requirements

  • NodeJS 10+
  • ExpressJS 4+
  • body-parser 1.4+

Installation

npm install --save express-sns-validator

Usage

Add to the route handler you will use to subscribe to Amazon SNS notifications. If the request does not validate, an HTTP 400 will be returned.

Note: you need body-parser to parse the JSON body from SNS.

const express = require('express')
const bodyParser = require('body-parser')
const snsMiddleware = require('express-sns-validator')

const app = express()

app.use(bodyParser.json()) // required for express-sns-validator to work properly

app.post('/notifications/sns', snsMiddleware(), (req, res) => {
  // do stuff with req.body
});

License

MIT License

Downloads/wk

79

GitHub Stars

0

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.1.2
latest
1yr ago
No alternatives found
No tutorials found
Add a tutorial