Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/wingleung/middy-aws-cookie-parser

A middy middleware to parse cookies on AWS
https://github.com/wingleung/middy-aws-cookie-parser

aws aws-lambda cookie lambda middleware middy

Last synced: 2 months ago
JSON representation

A middy middleware to parse cookies on AWS

Awesome Lists containing this project

README

        


Middy AWS cookie parsing middleware


Middy logo

AWS cookie parsing middleware for the middy framework





Known Vulnerabilities


npm version


npm install size


Known Vulnerabilities

Install

```shell
npm install middy-aws-cookie-parser --save
```

Usage

```typescript
import type { APIGatewayEventWithCookie } from 'middy-cookie-parser'

import middy from '@middy/core'
import CookieParser from 'middy-aws-cookie-parser'

async function baseHandler(event: Partial) {

// event.cookies is available as a parsed cookie jar

return {
statusCode: 200,
body: JSON.stringify(
event.cookies
)
}
}

const handler = middy(baseHandler)
.use(CookieParser())
```