Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

middy-middleware-warmup

1.0.3 • Public • Published

middy-middleware-warmup

BuildStatus

A middy plugin to help keep your Lambdas warm during Winter.

This plugin was created to be used with serverless-plugin-warmup. However, the plugin can also be configured.

Setup

Install via npm:

npm i --save middy-middleware-warmup

Usage

Use with middy;

const middy = require('middy');
const warmup = require('middy-middleware-warmup');
 
const handler = middy((event, context, callback) => {
});
 
handler.use(warmup({
  eventSource: 'custom-event-source',
  responseObject: { warm: true }
});

Defaults

const defaultOpts = {
  eventSource: 'serverless-plugin-warmup',
  responseObject: 'Ok.',
  enabled: true
};

Keywords

none

install

npm i middy-middleware-warmup

Downloadsweekly downloads

2

version

1.0.3

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability