3.7.1-alpha.4 • Published 2 years ago
@savaleukhin/next-aws-lambda v3.7.1-alpha.4
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 @savaleukhin/next-aws-lambda
Usage
const compat = require("@savaleukhin/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;
};
3.7.1-alpha.4
2 years ago
3.7.1-alpha.2
2 years ago