middy-middleware-warmup

A middy plugin to handle responding to warmup requests

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
middy-middleware-warmup
1.0.34 years ago4 years agoMinified + gzip package size for middy-middleware-warmup in KB

Readme

middy-middleware-warmup
Build
Status
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
};