middy-koa-wrapper
v2.1.0
Published
Wrap middy middleware to use with koa
Downloads
4
Readme
middy-koa-wrapper
Description
A wrapper to convert middy middleware for use with koa.
Usage
Vanilla JS
const eventNormaliser = require('@perform/sls-middleware-http-event-normalizer'); // the middy middleware
const { default: wrap } = require('middy-koa-wrapper');
app.use(wrap(eventNormaliser()));
ES6
import cors from '@middy/http-cors'; // the middy middleware
import wrap from 'middy-koa-wrapper';
app.use(wrap(eventNormaliser()));
API
Table of Contents
wrap
Main wrapper fn to convert middy middleware to koa middleware
Parameters
Returns Object async koa middleware object