Skip to content

Commit

Permalink
fix: fix Lambda@Edge event source
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-vendia committed Jan 6, 2021
1 parent a468c72 commit 95b0aa6
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 114 deletions.
2 changes: 1 addition & 1 deletion examples/alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```bash
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install --prefix ./src ./
node local.js
```
2 changes: 1 addition & 1 deletion examples/basic-starter-hapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To update this example against the latest local changes to serverless-express:

```bash
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install --prefix ./src ./
npm run local
```
2 changes: 1 addition & 1 deletion examples/basic-starter-koa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To update this example against the latest local changes to serverless-express:

```bash
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install --prefix ./src ./
npm run local
```
2 changes: 1 addition & 1 deletion examples/basic-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To update this example against the latest local changes to @vendia/serverless-ex

```bash
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install --prefix ./src ./
npm run local
```
2 changes: 1 addition & 1 deletion examples/custom-mapper-dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install --prefix ./src ./
node local.js
```
2 changes: 1 addition & 1 deletion examples/custom-mapper-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@vendia/serverless-express": "file:@vendia/serverless-express-3.3.5.tgz",
"@vendia/serverless-express": "file:vendia-serverless-express-4.0.0-rc.1.tgz",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"express": "^4.16.4",
Expand Down
6 changes: 3 additions & 3 deletions examples/lambda-edge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In addition to a basic Lambda function and Express server, this example includes

This guide assumes you have already [set up an AWS account](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/AboutAWSAccounts.html) and have the latest version of the [AWS CLI](https://aws.amazon.com/cli/) installed.

1. From your preferred project directory: `git clone https://github.com/vendia/serverless-express.git && cd serverless-express/examples/basic-starter`.
1. From your preferred project directory: `git clone https://github.com/vendia/serverless-express.git && cd serverless-express/examples/lambda-edge`.
2. Update the `config` section of `package.json` with your `s3BucketName` and `region` (optionally, change the `cloudFormationStackName`). If the bucket you specify does not yet exist, the next step will create it for you.
3. Run `npm run setup` - this installs the node dependencies, creates an S3 bucket (if it does not already exist), packages and deploys your serverless Express application to AWS Lambda, and creates an API Gateway proxy API.
4. After the setup command completes, open the AWS CloudFormation console https://console.aws.amazon.com/cloudformation/home and switch to the region you specified. Select the `ServerlessExpressEdge` stack (or the stack name you specified for `cloudFormationStackName`), then click the `ApiUrl` value under the __Outputs__ section - this will open a new page with your running API. The API index lists the resources available in the example Express server (`app.js`), along with example `curl` commands.
Expand All @@ -18,7 +18,7 @@ See the sections below for details on how to migrate an existing (or create a ne

Lambda@Edge has several limitations that you should be aware of. These include:

* 1MB code size. As a result, you'll need to use a build tool like Webpack (used in this example). This minimal example with sourcemaps comes in at ~0.2MB after bundling/minification.
* 1MB code size. As a result, you'll need to use a build tool like Webpack (used in this example). This minimal example with sourcemaps comes in at ~380KB after bundling/minification/zip.
* 40KB Response body size (53.2KB for base64 encoded body).
* 128MB Function RAM allocation.

Expand All @@ -31,7 +31,7 @@ To update this example against the latest local changes to serverless-express:

```bash
npm pack ../..
npm install ./@vendia/serverless-express-3.3.5.tgz
npm install ./vendia-serverless-express-4.0.0-rc.1.tgz
npm install
npm run build
npm run local
Expand Down
Loading

0 comments on commit 95b0aa6

Please sign in to comment.