4.1.0 • Published 9 months ago

@dolsze/next-aws-cloudfront v4.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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;
};

Options

Gzip compression

const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf, {
  enableHTTPCompression: true // false by default
});
4.1.0

9 months ago

1.2.3

9 months ago

1.1.11

9 months ago

1.1.6

9 months ago

1.0.9

9 months ago