An open API service indexing awesome lists of open source software.

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.

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 };
```