Skip to content

Commit 7ec8a92

Browse files
committed
Update README.md to include relevant configuration options
1 parent be69377 commit 7ec8a92

File tree

1 file changed

+54
-33
lines changed

1 file changed

+54
-33
lines changed

README.md

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# ember-cli-deploy-fastboot-api-lambda
22

3+
[![npm version](https://badge.fury.io/js/ember-cli-deploy-fastboot-api-lambda.svg)](https://badge.fury.io/js/ember-cli-deploy-fastboot-api-lambda)
4+
35
An ambitious ember-cli-deploy plugin for serving Ember FastBoot Applications entirely from within AWS Lambda/API Gateway (assets and all!).
46

7+
58
## Background
69
API Gateway [now supports the handling binary payloads](https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/), which means an end-to-end fastboot hosting solution can now be achieved through API gateway and Lambda without the use of S3 for serving static files. This is what this addon aims to achieve.
710

@@ -25,48 +28,66 @@ ember install ember-cli-deploy-fastboot-api-lambda
2528
```
2629
// config/deploy.js
2730
ENV['fastboot-api-lambda'] = {
28-
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
29-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
30-
31-
lambdaFunction: 'my-ember-app', // Lambda functions name
32-
region: 'us-east-1' // Region where lambda is deployed
31+
accessKeyId: process.env.AWS_ACCESS_KEY_ID, // (Required) AWS accessKeyId (must have permission to deploy lambda functions)
32+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, // (Required) AWS secretAccessKey
33+
lambdaFunction: 'my-ember-app', // (Required) Lambda functions name
34+
region: 'us-east-1', // (Required) Region where lambda is deployed
35+
36+
fallbackPath: '/' // (optional) The route that will be attempted if the current route fails. i.e. doesn't exist, fails etc.
37+
stringyExtensions: [ // (optional) The file extensions that will be treated as text and not binary. Defaults are shown. Any additional items will be concatenated to this list.
38+
'html',
39+
'css',
40+
'js',
41+
'json',
42+
'xml',
43+
'ico',
44+
'txt',
45+
'map'
46+
],
47+
validAssetPaths: [ // (optional) The assets paths that the lambda is explicitly allow serve. Defaults are shown. Any additional items will be concatenated to this list.
48+
'/assets/',
49+
'/robots.txt',
50+
'/humans.txt',
51+
'/crossdomain.xml',
52+
'/sitemap.xml'
53+
]
3354
};
3455
```
3556

3657
* Create the lambda function
37-
38-
* Open the [AWS Lambda console](https://console.aws.amazon.com/lambda).
39-
* Select the region that you defined in your deploy variables above.
40-
* Create a blank lambda, with the name you defined in your deploy variables above.
41-
* Handler => `index.handler`.
42-
* Role => `Create a custom role`. Give it a name and use the default policy document.
43-
* Memory => `128`.
44-
* Timeout => `30 seconds`.
45-
* Select `Next` and then select `Create function`.
58+
59+
* Open the [AWS Lambda console](https://console.aws.amazon.com/lambda).
60+
* Select the region that you defined in your deploy variables above.
61+
* Create a blank lambda, with the name you defined in your deploy variables above.
62+
* Handler => `index.handler`.
63+
* Role => `Create a custom role`. Give it a name and use the default policy document.
64+
* Memory => `128`.
65+
* Timeout => `30 seconds`.
66+
* Select `Next` and then select `Create function`.
4667

4768
* Create the API Gateway Proxy
48-
49-
* Open the [AWS API Gateway console](https://console.aws.amazon.com/apigateway).
50-
* Select the region that you defined in your deploy variables above.
51-
* Select `New API` and give it a name
52-
* Select Binary Support. Click `Edit`. Add `*/*` and click `Save`.
53-
* Create proxy method:
54-
* Under resources, click `/`, then click `Actions => Create Method`. Select `Any`.
55-
* Click the `Any label`, choose Integration type `lambda`, check the `Use Lambda Proxy integration` checkbox, and finally select your lambda function's region and name.
56-
* Create proxy resource:
57-
* Under resources, click `/`, then click `Actions => Create Resource`. Select `Any`.
58-
* Select `Configure as proxy resource`, and select `Enable API Gateway CORS`.
59-
* Select Integration type `Lambda Function Proxy`, and finally select your lambda function's region and name.
60-
* Under resources, click `Actions => Deploy API`. Select a new stage and give it the name `fastboot`. Hit `Deploy`. You will now see the `Invoke URL`. This is where you site will be hosted.
69+
70+
* Open the [AWS API Gateway console](https://console.aws.amazon.com/apigateway).
71+
* Select the region that you defined in your deploy variables above.
72+
* Select `New API` and give it a name
73+
* Select Binary Support. Click `Edit`. Add `*/*` and click `Save`.
74+
* Create proxy method:
75+
* Under resources, click `/`, then click `Actions => Create Method`. Select `Any`.
76+
* Click the `Any label`, choose Integration type `lambda`, check the `Use Lambda Proxy integration` checkbox, and finally select your lambda function's region and name.
77+
* Create proxy resource:
78+
* Under resources, click `/`, then click `Actions => Create Resource`. Select `Any`.
79+
* Select `Configure as proxy resource`, and select `Enable API Gateway CORS`.
80+
* Select Integration type `Lambda Function Proxy`, and finally select your lambda function's region and name.
81+
* Under resources, click `Actions => Deploy API`. Select a new stage and give it the name `fastboot`. Hit `Deploy`. You will now see the `Invoke URL`. This is where you site will be hosted.
6182

6283
* Ember Application
63-
* The `rootURL` must match the stage name you selected when creating the api gateway. Otherwise the `link-to` helper wont work.
64-
```
65-
// config/environment.js
66-
var ENV = {
67-
rootURL: '/fastboot/'
84+
* The `rootURL` must match the stage name you selected when creating the api gateway. Otherwise the `link-to` helper wont work.
85+
```
86+
// config/environment.js
87+
var ENV = {
88+
rootURL: '/fastboot/'
6889
}
69-
```
90+
```
7091

7192
* Configuration is done! 🎉
7293

0 commit comments

Comments
 (0)