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

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

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i next-aws-cloudfront-custom

    Weekly Downloads

    0

    Version

    0.0.1

    License

    ISC

    Unpacked Size

    19.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • hocnv