@sls-next/next-aws-lambda

3.5.0 • Public • Published

API Gateway Lambda Compat

Compat layer between next.js serverless page and API Gateway => Lambda Proxy Integration.

Lambda Proxy Integration event structure documentation can be found here.

Installation

npm install @sls-next/next-aws-lambda

Usage

const compat = require("@sls-next/next-aws-lambda");
const page = require(".next/serverless/pages/somePage.js");

// using callback

module.exports.render = (event, context, callback) => {
  compat(page)(event, context, callback);
};

// using async promise

module.exports.render = async (event, context) => {
  const responsePromise = compat(page)(event, context); // don't pass the callback parameter
  return responsePromise;
};

/@sls-next/next-aws-lambda/

    Package Sidebar

    Install

    npm i @sls-next/next-aws-lambda

    Weekly Downloads

    100

    Version

    3.5.0

    License

    MIT

    Unpacked Size

    23.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • danielconde
    • danielphang