Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including middy-middleware-warmup with all npm packages installed. Try it out:

var middyMiddlewareWarmup = require("middy-middleware-warmup")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

middy-middleware-warmup v1.0.3

A middy plugin to handle responding to warmup requests

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
};
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free