1.7.10 • Published 3 years ago

@getjerry/next-aws-cloudfront v1.7.10

Weekly downloads
60
License
MIT
Repository
github
Last release
3 years 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
});
1.7.3

3 years ago

1.7.2

3 years ago

1.7.9

3 years ago

1.7.10

3 years ago

1.7.8

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.0

4 years ago

1.6.1

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago