@getjerry/next-aws-lambda

2.6.14 • 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("@getjerry/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;
};

/@getjerry/next-aws-lambda/

    Package Sidebar

    Install

    npm i @getjerry/next-aws-lambda

    Weekly Downloads

    1

    Version

    2.6.14

    License

    MIT

    Unpacked Size

    30.1 kB

    Total Files

    8

    Last publish

    Collaborators

    • meteorlxy
    • xinzhe.zhou
    • xahhy
    • depeng_meng
    • musawir
    • denisgrankin
    • zhangciwu
    • xiazhen