https://github.com/joblocal/middy-json-api-parser
A middy middleware to parse JSON API requests.
https://github.com/joblocal/middy-json-api-parser
Last synced: about 2 months ago
JSON representation
A middy middleware to parse JSON API requests.
- Host: GitHub
- URL: https://github.com/joblocal/middy-json-api-parser
- Owner: joblocal
- Created: 2020-03-31T14:44:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T18:04:20.000Z (over 2 years ago)
- Last Synced: 2025-03-01T23:02:10.524Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 729 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Middy JSON API Parser
This is a [middy](https://middy.js.org/) middleware, which is parsing AWS API Gateway events according to the [JSON:API spec](https://jsonapi.org/).
## Installation
```sh
npm install @joblocal/middy-json-api-parser
```## Usage
```js
# handler.js
const middy = require('middy');
const jsonApiParser = require('@joblocal/middy-json-api-parser');const yourHandler = (event) => {
console.log(event.data);
};const handler = middy(yourHandler)
.use(jsonApiParser());module.exports = { handler };
```