Package Exports
- @apalchys/next-aws-lambda
- @apalchys/next-aws-lambda/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@apalchys/next-aws-lambda) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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;
};