1.0.2 • Published 2 years ago

@relambda/edge v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Relambda@Edge

The Relambda@Edge is a tiny handler that allows you to run Remix projects on AWS Lambda@Edge.

This package allows you to build infrastructure without forcing you to use a specific IaC library (how it has been done in @remix-run/architect).

NOTE: the Remix team won't create libraries like this. You can find more info in that thread.

Getting Started

To install the package run the next commands:

npm i @relambda/edge

This package has a peer dependency:

npm i @remix-run/node # usually it comes with Remix

Then you can create handler:

// server/index.js
import * as build from '@remix-run/dev/server-build'
import { createLambdaHandler } from '@relambda/edge'

export const lambdaHandler = createLambdaHandler({
  build,
  mode: process.env.NODE_ENV,
})

Don't forget to alter you Remix Config and add path to the server entry point:

// remix.config.js
module.exports = {
  server: 'server', // path to entry point
}

Build and deploy your magic to the AWS Lambda@Edge! 🤠