Skip to content

wingleung/middy-aws-cookie-parser

Repository files navigation

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

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

Usage

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

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

async function baseHandler(event: Partial<APIGatewayEventWithCookie>) {
  
  // event.cookies is available as a parsed cookie jar
  
  return {
    statusCode: 200,
    body: JSON.stringify(
      event.cookies
    )
  }
}

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

About

A middy middleware to parse cookies on AWS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published