thrive-next-aws-cloudfront
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

Next AWS CloudFront

Compat layer between next.js serverless page and CloudFront => Lambda@Edge.

Lambda@Edge event structure documentation can be found here.

Installation

npm install next-aws-cloudfront

Usage

const cloudFrontCompat = require("next-aws-cloudfront");
const page = require(".next/serverless/pages/somePage.js");

module.exports.render = async (event, context) => {
  const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf);
  page.render(req, res);
  return responsePromise;
};

Package Sidebar

Install

npm i thrive-next-aws-cloudfront

Weekly Downloads

1

Version

1.5.0

License

ISC

Unpacked Size

31.1 kB

Total Files

8

Last publish

Collaborators

  • thrivealbert